<template>
  <div class="container">
    <div id="map"></div>
    <div class="mask">
      <span class="mask_name">湖里区公益宣传阵地</span>
      <img class="bg" src="/images/main_mask.png" alt="" />
    </div>
    <VLeft @openEdit="openEdit" :overview="overview" />
    <VRight
      @clickItem="clickMoniTorItem"
      @openEdit="openDuteEdit"
      @openSelect="openSelect"
      @openBigScreen="openBigScreen"
      :duteListBK="duteListBK"
      :carouselList="carouselList"
      :duteListFK="duteListFK"
      :screenList="screenList"
      
    />
    <VCenter :list="list" :active="active" @select="(data) => (active = data)" />

    <div v-if="isShowFullIfr" class="fullifr">
      <iframe :src="currentIfr" @click="e=>console.log(e)" frameborder="0"></iframe>
      <div class="close" @click="isShowFullIfr = false">
        <img src="/images/close.png" alt="" />
      </div>
    </div>
    <div class="datecon">
      <div class="time">{{ currentTime }}</div>
      <div class="date">
        <div>{{ currentRiqi }} {{ currentDayofWeek }}</div>
      </div>
    </div>
    <div class="seachcon">
      <div class="seach">
        <img class="bg" src="/images/main_searchbg.png" alt="" />
        <input @keypress.enter="searchDevice" v-model="searchName" placeholder="搜索设备" type="text" />
        <img @click="searchDevice" class="search-icon" src="/images/main_search.png" alt="" />
      </div>
    </div>
    <teleport to="body">
      <div id="popup" class="ol-popup">
        <a href="#" id="popup-closer" class="ol-popup-closer"></a>
        <div id="popup-content"></div>
      </div>
      <VEdit v-if="isShowEdit" :editTitle="editTitle" :defaultTxt="defaultTxt" @close="isShowEdit = false" @confirm="editConfirm" />
      <VEditDute
        v-if="isShowEditDute"
        @refresh="getPersonInfo"
        :duteList="duteList"
        :duteType="duteType"
        @close="isShowEditDute = false"
        @confirm="editDuteConfirm"
      />
      <VSwiperSelect
        v-if="isShowSelect"
        @refresh="getPersonInfo"
        :monitorList="monitorList"
        :duteType="duteType"
        @close="isShowSelect = false"
        @confirm="editSelectConfirm"
      />

      <VEditBigscreen
        v-if="isBigScreen"
        :duteList="screenList"
        @refresh="notiyBigSreen"
        @close="notiyBigSreen"
        @confirm="notiyBigSreen"
      />
    </teleport>
  </div>
</template>

<script setup>
import { Map, View } from "ol";
import TileLayer from "ol/layer/Tile";
import OSM from "ol/source/OSM";
import { Polygon } from "ol/geom";
import XYZ from "ol/source/XYZ";
import { fromLonLat } from "ol/proj";
import { Icon, Fill, Stroke, Style } from "ol/style";
import VectorLayer from "ol/layer/Vector";
import VectorSource from "ol/source/Vector";
import Feature from "ol/Feature";
import Overlay from "ol/Overlay";
import Point from "ol/geom/Point";
import { onMounted, ref, watch } from "vue";
import VLeft from "./components/left.vue";
import VRight from "./components/right.vue";
import VCenter from "./components/center.vue";
import VEdit from "./components/edit.vue";
import VEditDute from "./components/edit-dute.vue";
import VEditBigscreen from "./components/edit-bigscreen.vue";
import VSwiperSelect from "./components/edit-swiper.vue";
// import markers from './data/markers';
import { raw } from "./data/index";

import axios from "axios";

// const IP = 'http://192.168.204.13'
// const DOMINIP = "http://18666186515.wicp.vip";
const DOMINIP = ''

const IP = window.location.protocol + "//" + window.location.hostname;
// const DOMINIP = ''

const jiankongDomain = DOMINIP + "/mediamtx/v3";

const rtspName = "streamShow";

const defaultZoom = 14.5;

let clickClose = false;

let mapData = [];
let overview = ref("");

let list = ref([]);
let carouselList = ref([]);

let active = ref("");

let jiankongs = ref([]);

let searchName = ref("");
let isShowEdit = ref(false);
let isShowEditDute = ref(false);
let isShowSelect = ref(false);
let isBigScreen = ref(false);

let isShowFullIfr = ref(false);

let currentIfr = ref("");

let editTitle = ref("");

let defaultTxt = ref("");

let duteListBK = ref([]);
let duteListFK = ref([]);
let duteList = ref([]);
let screenList = ref([]);


let monitorList = ref([]);

let duteType = ref(1);

let currentRemark = ref({});

let currentTime = ref("");
let currentRiqi = ref("");
let currentDayofWeek = ref("");

let updateClock = () => {
  const currentDate = new Date();
  const hours = currentDate.getHours();
  const minutes = currentDate.getMinutes();
  const seconds = currentDate.getSeconds();
  const year = currentDate.getFullYear();
  const month = currentDate.getMonth() + 1;
  const day = currentDate.getDate();
  const dayOfWeek = currentDate.getDay();

  // 格式化时间为双位数
  const formattedHours = String(hours).padStart(2, "0");
  const formattedMinutes = String(minutes).padStart(2, "0");
  const formattedSeconds = String(seconds).padStart(2, "0");

  currentTime.value = `${formattedHours}:${formattedMinutes}:${formattedSeconds}`;

  currentRiqi.value = `${year}/${month}/${day}`;

  currentDayofWeek.value = `星期${["日", "一", "二", "三", "四", "五", "六"][dayOfWeek]}`;
};

let vectorSource = new VectorSource();
let vectorLayer = new VectorLayer({
  source: vectorSource,
  zIndex: 999,
});
let map = null;
var closer = null;
var container = null;
var content = null;
var popup = null;

// 定义厦门市的经纬度边界
var xmin = 117.9328; // 最小经度
var ymin = 24.1963; // 最小纬度
var xmax = 118.3205; // 最大经度
var ymax = 24.7743; // 最大纬度
// 将经纬度边界转换为地图投影坐标
var extent = [...fromLonLat([xmin, ymin]), ...fromLonLat([xmax, ymax])];

let openEdit = (data) => {
  console.log(data);
  if (data == "整体概况") {
    editTitle.value = "整体概况";
    defaultTxt.value = overview.value;
  }
  isShowEdit.value = true;
};

let openSelect = (data) => {
  console.log(data);

  isShowSelect.value = true;
};

let openBigScreen = (data) => {
  console.log('result:111111111', data);
  screenList.value = data || []
  isBigScreen.value = true;
};


let openDuteEdit = (data) => {
  console.log(data);
  duteType.value = data;
  if (data == 1) {
  } else {
  }
  isShowEditDute.value = true;
};
let processText = (textInput) => {
  // 检测换行符、制表符和空格
  const newlinePattern = /\n/g;
  const tabPattern = /\t/g;
  const spacePattern = / /g;

  // 替换为可视化表示
  return textInput.replace(newlinePattern, "<br>").replace(tabPattern, "&emsp;").replace(spacePattern, "&nbsp;");
};
let editConfirm = (text) => {
  let txt = processText(text);
  console.log("result:txttttt", txt);
  if (currentRemark.value.id) {
    saveRemarkInfo(txt);
  } else {
    saveOverviewInfo(txt);
  }
};

let editSelectConfirm = async (data) => {
  if (data.length > 0) {
    let result = (
      await axios.post(DOMINIP + "/gy/att-camera-device-list/setCarousel", {
        ids: data.map((item) => {
          return item.id;
        }),
      })
    ).data;
  } else {
    alert("至少设置一项");
  }
  getMonitorList();
  isShowSelect.value = false;
};

let editDuteConfirm = async (data) => {
  if (data.length > 0) {
    let result = (
      await axios.post(
        DOMINIP + "/gy/att-person-info/autoUpdateStatus",
        data.map((item) => {
          return {
            id: item.id,
          };
        })
      )
    ).data;
  }
  isShowEditDute.value = false;
};


let notiyBigSreen = async (data) => {
  isBigScreen.value = false;
  getScreenPublicity()
};


let getCarouselList = async () => {
  carouselList.value = (await axios.get(DOMINIP + "/gy/att-camera-device-list/carouselList")).data.data;
};

let updateJK = () => {
  let activeItem = list.value.find((item) => item.name == active.value);
  updateRoad(activeItem, true);
  jiankongs.value.forEach((marker) => {
    // 创建标记要素
    var markerFeature = new Feature({
      geometry: new Point(fromLonLat([marker.lon, marker.lat])), // 标记要素的经纬度坐标
      data: marker,
    });
    // 设置标记要素的样式
    var markerStyle = new Style({
      image: new Icon({
        src: marker.onlinestate == 1 ? "/images/hp_video.png" : "/images/hp_warning.png", // 标记图标的路径
        scale: 0.2, // 标记图标的缩放大小
      }),
    });

    markerFeature.setStyle(markerStyle);
    // 将标记要素添加到矢量数据源
    vectorSource.addFeature(markerFeature);
  });
  map &&
    map.getView().animate({
      zoom: Math.max(map.getView().getZoom(), defaultZoom),
    });
};

let updateRoad = (marker, noPaintMarker = false) => {
  if (!marker) return;
  console.log("result:", marker);
  vectorSource.clear();
  var markerFeature = new Feature({
    geometry: new Point(fromLonLat(marker.lonlat)), // 标记要素的经纬度坐标
    data: marker,
  });

  if (!noPaintMarker) {
    // 设置标记要素的样式
    var markerStyle = new Style({
      image: new Icon({
        src: "/images/hp_video.png", // 标记图标的路径
        scale: 0.2, // 标记图标的缩放大小
      }),
    });

    markerFeature.setStyle(markerStyle);
    // 将标记要素添加到矢量数据源
    vectorSource.addFeature(markerFeature);
  }

  marker.maskFeature.setStyle(
    new Style({
      // fill: new Fill({
      //   color: 'rgba(160, 207, 255, 0)' // 蒙层填充颜色和透明度
      // }),
      stroke: new Stroke({
        lineDash: [5, 5],
        color: "rgba(0,100,252,1)", // 描边颜色
        width: 2, // 描边宽度
      }),
    })
  );
  vectorSource.addFeature(marker.maskFeature);
};

let getOverviewInfo = async () => {
  let result = (await axios.get(DOMINIP + "/gy/att-overview/info", {})).data;
  overview.value = result.data.content;
};

let getDeviceList = async () => {
  let ipMap = (await axios.get(DOMINIP + "/gy/att-camera-device-list/list")).data.data;
  mapData = ipMap;
  // mapData = ipMap.map((item) => {
  //   //前缀加@@是为了避免57也匹配到157这种情况出现
  //   let ipItem = raw.find((sub) => {
  //     let subSplitArr = sub.split(";");
  //     // console.log('result:', splitArr);
  //     return ("@@" + subSplitArr[0]).indexOf("@@" + item.code) > -1;
  //   });

  //   let splitArr = ipItem ? ipItem.split(";") : [];

  //   return {
  //     name: splitArr[0],
  //     address: splitArr[1],
  //     lon: splitArr[2],
  //     lat: splitArr[3],
  //     idx: splitArr[4],
  //     ip: item.ip,
  //     id: item.id,
  //     onlinestate: item.onlinestate,
  //     type: splitArr[5],
  //   };
  // });

  list.value = [
    {
      id: "huliqu",
      short: "区",
      name: "湖里区",
      num: mapData.length,
      lonlat: [118.1365, 24.5254],
      zoom: 12,
      maskFeature: new Feature({
        geometry: new Polygon([
          [
            fromLonLat([118.16594683045857, 24.512734385223435]),
            fromLonLat([118.1665852935993, 24.51266851115783]),
            fromLonLat([118.17156040550654, 24.51472618988857]),
            fromLonLat([118.17501278938605, 24.517121176093667]),
            fromLonLat([118.18237339036777, 24.525931614407856]),
            fromLonLat([118.18248475249692, 24.527648817896985]),
            fromLonLat([118.18071450839149, 24.532350642480768]),
            fromLonLat([118.17930732485456, 24.537596242898477]),
            fromLonLat([118.17971846902765, 24.538161444490626]),
            fromLonLat([118.19017493960831, 24.533024992962282]),
            fromLonLat([118.19517904478316, 24.530070160896454]),
            fromLonLat([118.19850478236404, 24.525711827228758]),
            fromLonLat([118.19805888109595, 24.52333335816645]),
            fromLonLat([118.19825113567927, 24.510406711835746]),
            fromLonLat([118.19864548729987, 24.50281401426756]),
            fromLonLat([118.19797033218347, 24.502670853537197]),
            fromLonLat([118.19786254982318, 24.502314091682646]),
            fromLonLat([118.19747443576, 24.502140805316348]),
            fromLonLat([118.1973666649865, 24.50189303058173]),
            fromLonLat([118.19752322669103, 24.501053863174057]),
            fromLonLat([118.19705024226771, 24.500077838782122]),
            fromLonLat([118.19715399325978, 24.499994664235757]),
            fromLonLat([118.19671499716326, 24.499755483363472]),
            fromLonLat([118.19626903630277, 24.499685293515277]),
            fromLonLat([118.19630692789266, 24.499463256107681]),
            fromLonLat([118.19601859675191, 24.499362788880283]),
            fromLonLat([118.19603853286321, 24.499167779583932]),
            fromLonLat([118.19480740180259, 24.498714069492316]),
            fromLonLat([118.19463675626221, 24.498126460862192]),
            fromLonLat([118.19404116951623, 24.49806555406261]),
            fromLonLat([118.19317425259926, 24.498169124771621]),
            fromLonLat([118.19291082601696, 24.497475705319335]),
            fromLonLat([118.19135259466933, 24.49751856656346]),
            fromLonLat([118.19136461616159, 24.498112459983311]),
            fromLonLat([118.19084487036558, 24.497999435652574]),
            fromLonLat([118.19073118748486, 24.498465579890556]),
            fromLonLat([118.19029825096705, 24.498553368494502]),
            fromLonLat([118.1894582705464, 24.498124984762988]),
            fromLonLat([118.18925572138291, 24.497574438582255]),
            fromLonLat([118.18846965976657, 24.497617891665403]),
            fromLonLat([118.18819833754057, 24.497712382023373]),
            fromLonLat([118.18761778649329, 24.497864439084367]),
            fromLonLat([118.18704619298117, 24.49773752078957]),
            fromLonLat([118.18675791047164, 24.497749055089191]),
            fromLonLat([118.18672001093071, 24.497822115751607]),
            fromLonLat([118.18629506602713, 24.497788910650804]),
            fromLonLat([118.1863319444203, 24.49743689286176]),
            fromLonLat([118.18621621688634, 24.497247136024004]),
            fromLonLat([118.18455120943841, 24.495187540280863]),
            fromLonLat([118.18455020407708, 24.495092556473466]),
            fromLonLat([118.18489231208966, 24.494674981389018]),
            fromLonLat([118.18493613892689, 24.49390301640635]),
            fromLonLat([118.18474153025363, 24.492721558454878]),
            fromLonLat([118.18458389922949, 24.492395902573865]),
            fromLonLat([118.18440334679549, 24.492327250163097]),
            fromLonLat([118.18392758625805, 24.492866053699679]),
            fromLonLat([118.18378997419298, 24.493378231893374]),
            fromLonLat([118.18365932059035, 24.493589442873105]),
            fromLonLat([118.18307083307855, 24.493951484000014]),
            fromLonLat([118.18235266905519, 24.494225778618841]),
            fromLonLat([118.18175821587297, 24.494749804044478]),
            fromLonLat([118.18152883875621, 24.495265151684173]),
            fromLonLat([118.18145606850207, 24.495832201529375]),
            fromLonLat([118.1812835550886, 24.496439431081061]),
            fromLonLat([118.18090161621537, 24.497577971255488]),
            fromLonLat([118.18035101182035, 24.497565993273085]),
            fromLonLat([118.17932553405164, 24.49652604765971]),
            fromLonLat([118.17978232265266, 24.495912293889486]),
            fromLonLat([118.18021114860063, 24.494864658278395]),
            fromLonLat([118.18039765362262, 24.494594353779402]),
            fromLonLat([118.18045049062415, 24.494239309900447]),
            fromLonLat([118.1806120661971, 24.494060037439457]),
            fromLonLat([118.18068085841823, 24.493652972482746]),
            fromLonLat([118.18018609779472, 24.493429925391627]),
            fromLonLat([118.17970822236737, 24.492299987477395]),
            fromLonLat([118.17821209857146, 24.493123627014679]),
            fromLonLat([118.17718174412357, 24.493340495113838]),
            fromLonLat([118.17506916243518, 24.493642333867673]),
            fromLonLat([118.17494245900214, 24.493298620529803]),
            fromLonLat([118.17499125741229, 24.492296688905679]),
            fromLonLat([118.1751487255429, 24.490616668606314]),
            fromLonLat([118.17518859533962, 24.490248654977972]),
            fromLonLat([118.17512868101127, 24.489372907406661]),
            fromLonLat([118.17498297698609, 24.48838233750682]),
            fromLonLat([118.17457303388206, 24.488500070398196]),
            fromLonLat([118.17321542287908, 24.487440731223145]),
            fromLonLat([118.17290321703845, 24.487397309574742]),
            fromLonLat([118.1726887511121, 24.487217730911389]),
            fromLonLat([118.17239749450161, 24.487214262757501]),
            fromLonLat([118.17203543819868, 24.487469880225923]),
            fromLonLat([118.17184797530994, 24.488257091213026]),
            fromLonLat([118.17125547726025, 24.488136189161224]),
            fromLonLat([118.17086246068747, 24.487901942235172]),
            fromLonLat([118.17089736199488, 24.487773899637734]),
            fromLonLat([118.1700445003865, 24.487344519502692]),
            fromLonLat([118.16940012170495, 24.487131721906415]),
            fromLonLat([118.16899613089515, 24.486913488731535]),
            fromLonLat([118.16854323936226, 24.486384395422373]),
            fromLonLat([118.16818018417969, 24.486722993652297]),
            fromLonLat([118.16801259070725, 24.486482335898266]),
            fromLonLat([118.16746893423257, 24.486081382804034]),
            fromLonLat([118.16719963462681, 24.486357819784381]),
            fromLonLat([118.16700012801924, 24.486216202895108]),
            fromLonLat([118.16621807107052, 24.485865665696764]),
            fromLonLat([118.16542914082675, 24.48708887247782]),
            fromLonLat([118.16525656704896, 24.487004194951389]),
            fromLonLat([118.16489644269593, 24.486649898566753]),
            fromLonLat([118.16483356785619, 24.4862150836586]),
            fromLonLat([118.16439066396104, 24.486075897204763]),
            fromLonLat([118.16449038051448, 24.485601799105744]),
            fromLonLat([118.16386893413828, 24.485664895913608]),
            fromLonLat([118.16270383304969, 24.485781946294797]),
            fromLonLat([118.16215902443932, 24.483665270616505]),
            fromLonLat([118.16093498672494, 24.483024541369883]),
            fromLonLat([118.16089806821341, 24.482901627128875]),
            fromLonLat([118.16096688343391, 24.482674545056884]),
            fromLonLat([118.16070151494935, 24.482436052958199]),
            fromLonLat([118.1606117161861, 24.482182254447995]),
            fromLonLat([118.160097978707, 24.482304136726356]),
            fromLonLat([118.1589727092324, 24.482287111204137]),
            fromLonLat([118.15897372800414, 24.482576060007116]),
            fromLonLat([118.15771674679269, 24.482475268474413]),
            fromLonLat([118.15768682988367, 24.482638293152828]),
            fromLonLat([118.15721096185463, 24.482551134762925]),
            fromLonLat([118.1571361509894, 24.482695239566215]),
            fromLonLat([118.15653057492, 24.482462327541135]),
            fromLonLat([118.1565993901678, 24.482175257380835]),
            fromLonLat([118.15639487453122, 24.482155614176055]),
            fromLonLat([118.15461111545045, 24.482756580048591]),
            fromLonLat([118.15405040550621, 24.482533575763654]),
            fromLonLat([118.15285413512508, 24.48205568730511]),
            fromLonLat([118.15256679474605, 24.482072170982864]),
            fromLonLat([118.15140442388989, 24.481821167220641]),
            fromLonLat([118.15002251568157, 24.481631498300779]),
            fromLonLat([118.14966430168832, 24.481466117890456]),
            fromLonLat([118.14935796283208, 24.481222662150461]),
            fromLonLat([118.14843793653225, 24.480489289534116]),
            fromLonLat([118.14805479493342, 24.480785864205522]),
            fromLonLat([118.14708389977328, 24.480783432616466]),
            fromLonLat([118.14504021141198, 24.480283757449186]),
            fromLonLat([118.14460614448221, 24.480614382190826]),
            fromLonLat([118.1439944301915, 24.480820297645145]),
            fromLonLat([118.14466222909736, 24.483469838908963]),
            fromLonLat([118.14484589483321, 24.484197435778725]),
            fromLonLat([118.14532202117104, 24.486047395550557]),
            fromLonLat([118.14569144855278, 24.48920032012013]),
            fromLonLat([118.14543801710681, 24.489721641295453]),
            fromLonLat([118.14356797883006, 24.490815399273885]),
            fromLonLat([118.14188541375943, 24.491124917621029]),
            fromLonLat([118.14173072473463, 24.491142147318971]),
            fromLonLat([118.14157803251655, 24.491182370152902]),
            fromLonLat([118.13800398867193, 24.491459503841135]),
            fromLonLat([118.13753887125934, 24.491607128799089]),
            fromLonLat([118.13708972280925, 24.491849710449312]),
            fromLonLat([118.13653875681743, 24.492124419416335]),
            fromLonLat([118.13415005416559, 24.492135546442835]),
            fromLonLat([118.13301501588086, 24.491932990360652]),
            fromLonLat([118.13206062568763, 24.491671180758569]),
            fromLonLat([118.12930504876368, 24.490189515800655]),
            fromLonLat([118.1283026226608, 24.490195575466405]),
            fromLonLat([118.12825768965571, 24.490156627426487]),
            fromLonLat([118.1282047743683, 24.49019667660199]),
            fromLonLat([118.12793622028278, 24.490701882215937]),
            fromLonLat([118.12775453622525, 24.491307983374803]),
            fromLonLat([118.12765971532961, 24.491861002506006]),
            fromLonLat([118.12760781506161, 24.49219100939909]),
            fromLonLat([118.12628516314511, 24.498218489835356]),
            fromLonLat([118.12648587991404, 24.498474262953497]),
            fromLonLat([118.12642199559808, 24.498817278969508]),
            fromLonLat([118.12641500723237, 24.498844281514049]),
            fromLonLat([118.12616444582447, 24.500000366614014]),
            fromLonLat([118.12608059170235, 24.500386394490885]),
            fromLonLat([118.12584599892159, 24.501462472446796]),
            fromLonLat([118.12576913194104, 24.501814497658344]),
            fromLonLat([118.12566032004884, 24.502310533634951]),
            fromLonLat([118.125639356127, 24.502406540316766]),
            fromLonLat([118.12554451961331, 24.502841569950654]),
            fromLonLat([118.12517710440517, 24.503750787181769]),
            fromLonLat([118.12462293795735, 24.504460190044316]),
            fromLonLat([118.12297118739954, 24.503741684138689]),
            fromLonLat([118.12266358346196, 24.50342297349783]),
            fromLonLat([118.12272149802423, 24.503296943462576]),
            fromLonLat([118.12266855964225, 24.503149005451647]),
            fromLonLat([118.12229307177027, 24.503314278936134]),
            fromLonLat([118.11815907771745, 24.501084397058619]),
            fromLonLat([118.11045664296719, 24.49988773760774]),
            fromLonLat([118.10550497727615, 24.497663700992927]),
            fromLonLat([118.10371291038913, 24.497074773111184]),
            fromLonLat([118.10368992197441, 24.497065772960081]),
            fromLonLat([118.10331109843125, 24.496941770847304]),
            fromLonLat([118.10329810476638, 24.496938771285205]),
            fromLonLat([118.1002712619042, 24.495943553647937]),
            fromLonLat([118.09392809644942, 24.492469146385737]),
            fromLonLat([118.09082871339437, 24.490076007964081]),
            fromLonLat([118.09080970971156, 24.490062999969574]),
            fromLonLat([118.09079970794485, 24.49005299556951]),
            fromLonLat([118.08811898469077, 24.487984722086257]),
            fromLonLat([118.08560779139705, 24.483476660039834]),
            fromLonLat([118.08394190755205, 24.481477686478989]),
            fromLonLat([118.08201884775268, 24.480905163772768]),
            fromLonLat([118.08199983645089, 24.480900148520426]),
            fromLonLat([118.08197281984441, 24.480891125746073]),
            fromLonLat([118.08063197281453, 24.480493969026568]),
            fromLonLat([118.0781540232895, 24.477515987651834]),
            fromLonLat([118.07813100366604, 24.47748796773632]),
            fromLonLat([118.07805493938318, 24.477396903122397]),
            fromLonLat([118.07802891700845, 24.477365881207383]),
            fromLonLat([118.07794484514197, 24.477264808998314]),
            fromLonLat([118.07789480722973, 24.477268755754167]),
            fromLonLat([118.07786577747133, 24.477169741089583]),
            fromLonLat([118.07735333270824, 24.476550293801644]),
            fromLonLat([118.07711914112595, 24.476499048350174]),
            fromLonLat([118.077164172382, 24.476434107769443]),
            fromLonLat([118.077206202309, 24.476375163127088]),
            fromLonLat([118.07668072980069, 24.475741690730452]),
            fromLonLat([118.07617529305257, 24.47556615283694]),
            fromLonLat([118.07514110467964, 24.47522278157469]),
            fromLonLat([118.07532655508389, 24.475455642553474]),
            fromLonLat([118.07538968454192, 24.47549854045808]),
            fromLonLat([118.07507748379956, 24.47649789530908]),
            fromLonLat([118.07417297132733, 24.482987485768099]),
            fromLonLat([118.07621749760924, 24.494919842557604]),
            fromLonLat([118.07805654766969, 24.498942481173188]),
            fromLonLat([118.08297098936949, 24.50792004811235]),
            fromLonLat([118.08652678861303, 24.519375184242236]),
            fromLonLat([118.08643464388395, 24.520131701408136]),
            fromLonLat([118.09286384224254, 24.537909688495535]),
            fromLonLat([118.09847631073437, 24.543950116217079]),
            fromLonLat([118.10207498603727, 24.547149162864319]),
            fromLonLat([118.10550365115374, 24.551186219074204]),
            fromLonLat([118.10659378174093, 24.552063962061691]),
            fromLonLat([118.10660941750059, 24.552072993435353]),
            fromLonLat([118.10714552663688, 24.552458423600516]),
            fromLonLat([118.11675271264689, 24.552758930142584]),
            fromLonLat([118.13852353504714, 24.555874839352398]),
            fromLonLat([118.13962707070674, 24.55612805879986]),
            fromLonLat([118.14116029427856, 24.557025440135053]),
            fromLonLat([118.14245934961416, 24.557278313733008]),
            fromLonLat([118.14522575555461, 24.557070641834596]),
            fromLonLat([118.14627640967866, 24.556540879809425]),
            fromLonLat([118.15176425156072, 24.550211918646298]),
            fromLonLat([118.15800271552956, 24.544450223885384]),
            fromLonLat([118.15949110020581, 24.543943458766435]),
            fromLonLat([118.16554722122, 24.543863119421609]),
            fromLonLat([118.17578060960851, 24.539771852441977]),
            fromLonLat([118.17435978119096, 24.537236791229791]),
            fromLonLat([118.1710981182402, 24.534937403227985]),
            fromLonLat([118.17039086145897, 24.534003731320034]),
            fromLonLat([118.16996257794193, 24.532699399463699]),
            fromLonLat([118.17011938460621, 24.530911404595823]),
            fromLonLat([118.17418453775029, 24.526219564983471]),
            fromLonLat([118.17437206049973, 24.522545691094024]),
            fromLonLat([118.1738194184426, 24.520625260866879]),
            fromLonLat([118.17311497781125, 24.519208646873263]),
            fromLonLat([118.1718241425629, 24.517845483487939]),
            fromLonLat([118.17037011374209, 24.517165643746495]),
            fromLonLat([118.16592648101287, 24.516179329346052]),
            fromLonLat([118.165120338412, 24.515038734402495]),
            fromLonLat([118.16509382897645, 24.51357974672063]),
            fromLonLat([118.16594683045857, 24.512734385223435]),
          ],
        ]),
      }),
    },
    {
      id: "hu",
      short: "湖",
      name: "湖里街道",
      num: mapData.filter((item) => item.type == "湖里街道").length,
      lonlat: [118.0965, 24.5054],
      maskFeature: new Feature({
        geometry: new Polygon([
          [
            fromLonLat([118.07802443456389, 24.477686460980859]),
            fromLonLat([118.07798738212239, 24.477345483683568]),
            fromLonLat([118.07774916391969, 24.476830306829935]),
            fromLonLat([118.07770213702459, 24.476958232929654]),
            fromLonLat([118.07646414141345, 24.476853808127185]),
            fromLonLat([118.0750198882691, 24.476741059991038]),
            fromLonLat([118.07508207572043, 24.478575805714627]),
            fromLonLat([118.07513413639455, 24.478773839471526]),
            fromLonLat([118.075310300385, 24.47888203177774]),
            fromLonLat([118.07501006282514, 24.479293582050758]),
            fromLonLat([118.07531334595602, 24.47947893138134]),
            fromLonLat([118.07524428969469, 24.479684813137087]),
            fromLonLat([118.07491999916408, 24.479534430925138]),
            fromLonLat([118.07481192505202, 24.479862233093407]),
            fromLonLat([118.07517525387107, 24.479899683340552]),
            fromLonLat([118.07506117080752, 24.480159499954727]),
            fromLonLat([118.07482995812374, 24.480095219287289]),
            fromLonLat([118.07485497623631, 24.480032260738952]),
            fromLonLat([118.07476187990835, 24.480005147373195]),
            fromLonLat([118.07465281336242, 24.480322949257559]),
            fromLonLat([118.07500613630353, 24.480365388689858]),
            fromLonLat([118.07490706838598, 24.480660218022045]),
            fromLonLat([118.07470588305348, 24.4806189702688]),
            fromLonLat([118.07473088842822, 24.480516018064311]),
            fromLonLat([118.07460777407982, 24.480488866024878]),
            fromLonLat([118.07407240048997, 24.482068902691438]),
            fromLonLat([118.07421954112907, 24.48210607704609]),
            fromLonLat([118.07424455802368, 24.482016133216678]),
            fromLonLat([118.07444574875242, 24.482071372876749]),
            fromLonLat([118.07441572768317, 24.482164320056178]),
            fromLonLat([118.07404738756188, 24.48221683736417]),
            fromLonLat([118.07461917401139, 24.485770947362479]),
            fromLonLat([118.07601000083875, 24.494250245414261]),
            fromLonLat([118.07589891630833, 24.494252110321021]),
            fromLonLat([118.07591393575613, 24.494344115416634]),
            fromLonLat([118.07595298611216, 24.494581128971706]),
            fromLonLat([118.0760410509174, 24.494580235822777]),
            fromLonLat([118.07614016767977, 24.494899300017053]),
            fromLonLat([118.07826391570195, 24.495798614119867]),
            fromLonLat([118.07811382114414, 24.496039402550675]),
            fromLonLat([118.0786942660927, 24.496294008820264]),
            fromLonLat([118.07879632181876, 24.496049154795493]),
            fromLonLat([118.07896044403859, 24.496123322475757]),
            fromLonLat([118.07875032413266, 24.496540025365633]),
            fromLonLat([118.07857419361102, 24.496494838855643]),
            fromLonLat([118.07854817878317, 24.496551802223863]),
            fromLonLat([118.07973504618762, 24.497068994095738]),
            fromLonLat([118.07987111228795, 24.496725194565865]),
            fromLonLat([118.08023536163766, 24.496872550332359]),
            fromLonLat([118.08029340499115, 24.496954588253953]),
            fromLonLat([118.08023136422874, 24.497083506598241]),
            fromLonLat([118.08009829037465, 24.497120364536315]),
            fromLonLat([118.08077274022416, 24.497402000737356]),
            fromLonLat([118.08084379103499, 24.49749705848674]),
            fromLonLat([118.08096084943013, 24.497309211379349]),
            fromLonLat([118.08138912616523, 24.497577585145535]),
            fromLonLat([118.08157425073647, 24.497800733555344]),
            fromLonLat([118.08136914089579, 24.497946504123497]),
            fromLonLat([118.08193750273298, 24.498410976482067]),
            fromLonLat([118.08199853224659, 24.498344043679701]),
            fromLonLat([118.08168533613897, 24.498093789704217]),
            fromLonLat([118.08191043888515, 24.497875035435904]),
            fromLonLat([118.08211757113752, 24.497961219448648]),
            fromLonLat([118.08261887123298, 24.498487602679337]),
            fromLonLat([118.08297407982018, 24.498669901136807]),
            fromLonLat([118.08297008582828, 24.498781881988144]),
            fromLonLat([118.08273898112559, 24.498994632440603]),
            fromLonLat([118.08303513972537, 24.499067891053361]),
            fromLonLat([118.08328725782657, 24.498942134171291]),
            fromLonLat([118.08434382267019, 24.499855902877389]),
            fromLonLat([118.08423478246597, 24.499977793998195]),
            fromLonLat([118.08415173994737, 24.499910732720902]),
            fromLonLat([118.08395265971771, 24.50007054046257]),
            fromLonLat([118.08427083262498, 24.500448749837911]),
            fromLonLat([118.0844439193789, 24.500581877274428]),
            fromLonLat([118.08450494184896, 24.500520936661712]),
            fromLonLat([118.08419778701752, 24.500273711966841]),
            fromLonLat([118.08437785446559, 24.500086899740527]),
            fromLonLat([118.08429781423609, 24.500024840836051]),
            fromLonLat([118.08439785090056, 24.499913940329343]),
            fromLonLat([118.08569744855286, 24.50077785534797]),
            fromLonLat([118.08600059358959, 24.501223019395351]),
            fromLonLat([118.08618266490626, 24.501301147803364]),
            fromLonLat([118.0863237028744, 24.501137276836644]),
            fromLonLat([118.08682189959954, 24.501536592150803]),
            fromLonLat([118.08666586074754, 24.501709444059642]),
            fromLonLat([118.08695696889178, 24.501895631684331]),
            fromLonLat([118.08697597551664, 24.502042615520772]),
            fromLonLat([118.08726808722328, 24.502196804185239]),
            fromLonLat([118.08739814731659, 24.502489846618506]),
            fromLonLat([118.08778128659527, 24.502896058598722]),
            fromLonLat([118.08807237869478, 24.503081221936405]),
            fromLonLat([118.08817641995418, 24.50327726551939]),
            fromLonLat([118.08856652851388, 24.503437491890569]),
            fromLonLat([118.08875555418751, 24.503178659137333]),
            fromLonLat([118.08881155920459, 24.503070709634788]),
            fromLonLat([118.08922266150269, 24.503252944922398]),
            fromLonLat([118.0894236824243, 24.502980105868225]),
            fromLonLat([118.09189615787901, 24.504912186751842]),
            fromLonLat([118.09225321666291, 24.505399288591068]),
            fromLonLat([118.09243424364431, 24.505640343963929]),
            fromLonLat([118.09260026985139, 24.505901378233794]),
            fromLonLat([118.09255928284644, 24.506105332068387]),
            fromLonLat([118.09289735947033, 24.507008350694644]),
            fromLonLat([118.09297536452524, 24.507191352296569]),
            fromLonLat([118.0932984580695, 24.508426315991898]),
            fromLonLat([118.09370557221574, 24.50989327226042]),
            fromLonLat([118.09387461305877, 24.510502244997387]),
            fromLonLat([118.09469479589328, 24.513659101486688]),
            fromLonLat([118.09479482708079, 24.514043091240307]),
            fromLonLat([118.09495485993165, 24.514657054253792]),
            fromLonLat([118.09516988241943, 24.515209053649638]),
            fromLonLat([118.09547689155953, 24.515733086217544]),
            fromLonLat([118.09606586983469, 24.516373191113946]),
            fromLonLat([118.09699477118686, 24.516968371549829]),
            fromLonLat([118.0978726195716, 24.517258558591312]),
            fromLonLat([118.09896136197786, 24.517377761828737]),
            fromLonLat([118.09919729784566, 24.517393802249337]),
            fromLonLat([118.10012700881771, 24.517456937418924]),
            fromLonLat([118.10153951475041, 24.517552069455334]),
            fromLonLat([118.10183239820034, 24.51757208574751]),
            fromLonLat([118.10319280271838, 24.517664111971687]),
            fromLonLat([118.10694271042703, 24.518138728830433]),
            fromLonLat([118.10985764580913, 24.518516009058715]),
            fromLonLat([118.11092679703127, 24.518802630669789]),
            fromLonLat([118.11155928032103, 24.519111373620202]),
            fromLonLat([118.11204687637806, 24.519444142873184]),
            fromLonLat([118.11341372178015, 24.520863384929388]),
            fromLonLat([118.11406813699247, 24.521649977357505]),
            fromLonLat([118.11455562882682, 24.521298796599137]),
            fromLonLat([118.11573836402009, 24.520472311094935]),
            fromLonLat([118.1164165878432, 24.519757034522662]),
            fromLonLat([118.11643456684642, 24.519736026923201]),
            fromLonLat([118.11699590504875, 24.519091801975616]),
            fromLonLat([118.11763411232413, 24.518030568080608]),
            fromLonLat([118.11769403112916, 24.517849553236072]),
            fromLonLat([118.11777292422656, 24.517614543122285]),
            fromLonLat([118.11777991465647, 24.517592541472528]),
            fromLonLat([118.1181164551279, 24.516584474112602]),
            fromLonLat([118.11835605918513, 24.514953561587653]),
            fromLonLat([118.11763987395069, 24.514953008104197]),
            fromLonLat([118.11680581737714, 24.514963501127557]),
            fromLonLat([118.11593374923409, 24.514949989919501]),
            fromLonLat([118.11592776350072, 24.51492099672058]),
            fromLonLat([118.11586081114437, 24.514597072704039]),
            fromLonLat([118.11603948093094, 24.512650267632967]),
            fromLonLat([118.11608239110181, 24.512178313348571]),
            fromLonLat([118.11613729948171, 24.511583368125979]),
            fromLonLat([118.11850763838515, 24.511575955023819]),
            fromLonLat([118.11872539983362, 24.511825772492731]),
            fromLonLat([118.11934757138162, 24.510655537270686]),
            fromLonLat([118.11940248748908, 24.510552513165646]),
            fromLonLat([118.11977399410375, 24.509853367568269]),
            fromLonLat([118.11990281828997, 24.509612308830221]),
            fromLonLat([118.12065978793758, 24.508428951745699]),
            fromLonLat([118.12070872133357, 24.508363924529032]),
            fromLonLat([118.12119105393631, 24.507784653561995]),
            fromLonLat([118.12162146605182, 24.507363393164692]),
            fromLonLat([118.12261209388009, 24.506391765113932]),
            fromLonLat([118.12397812073601, 24.505166827550898]),
            fromLonLat([118.12437554550748, 24.504810533355418]),
            fromLonLat([118.12462915352438, 24.504510362338191]),
            fromLonLat([118.122978411478, 24.503794873063335]),
            fromLonLat([118.12267080479864, 24.503475164694617]),
            fromLonLat([118.12272871763251, 24.503349145009121]),
            fromLonLat([118.12256490512631, 24.502890348072839]),
            fromLonLat([118.12243506547297, 24.502700477097846]),
            fromLonLat([118.12212346720902, 24.502657728560255]),
            fromLonLat([118.12204555158648, 24.502258853269069]),
            fromLonLat([118.12211036359174, 24.500839025565117]),
            fromLonLat([118.12176879922663, 24.50064031767889]),
            fromLonLat([118.12056931231731, 24.500240277832873]),
            fromLonLat([118.12044245095576, 24.500088400154802]),
            fromLonLat([118.1205303024858, 24.499421438657198]),
            fromLonLat([118.12017474192984, 24.499344703547663]),
            fromLonLat([118.12009183844188, 24.499254774557503]),
            fromLonLat([118.11949556967438, 24.499241200029815]),
            fromLonLat([118.11948362207193, 24.499767115669208]),
            fromLonLat([118.11884837639958, 24.499782538686951]),
            fromLonLat([118.11837693994218, 24.499896828279404]),
            fromLonLat([118.11808529608645, 24.500137979654742]),
            fromLonLat([118.11796243951083, 24.500163052933285]),
            fromLonLat([118.11766877539299, 24.500024252958585]),
            fromLonLat([118.11780560055522, 24.499763204958903]),
            fromLonLat([118.1176297946357, 24.499676334576375]),
            fromLonLat([118.11746299767185, 24.49987339846745]),
            fromLonLat([118.11671677365321, 24.499260931238041]),
            fromLonLat([118.11685160642098, 24.498857919415837]),
            fromLonLat([118.11668379378214, 24.498900010012207]),
            fromLonLat([118.11517638585397, 24.498781851848801]),
            fromLonLat([118.11462794038169, 24.498740131536987]),
            fromLonLat([118.11379773396794, 24.498393570930226]),
            fromLonLat([118.11262681960316, 24.498304087126176]),
            fromLonLat([118.11202231440562, 24.49747146113117]),
            fromLonLat([118.11168958884085, 24.497216631253519]),
            fromLonLat([118.11136989749372, 24.497661674206153]),
            fromLonLat([118.11105117445055, 24.497742773494132]),
            fromLonLat([118.11041270712444, 24.497791975386487]),
            fromLonLat([118.1100689664849, 24.497684095737274]),
            fromLonLat([118.10954833560166, 24.496986353400921]),
            fromLonLat([118.10948929761037, 24.495964543610899]),
            fromLonLat([118.10965616545587, 24.495787522247713]),
            fromLonLat([118.10970510104109, 24.495423569989022]),
            fromLonLat([118.10887065286298, 24.494253978547267]),
            fromLonLat([118.10853691243776, 24.494451030867022]),
            fromLonLat([118.10806524823742, 24.494421140776552]),
            fromLonLat([118.10769247328257, 24.493939296485671]),
            fromLonLat([118.10715180810259, 24.493517467773589]),
            fromLonLat([118.10657216879549, 24.493300593006261]),
            fromLonLat([118.10614040838645, 24.493016704537617]),
            fromLonLat([118.10600246795853, 24.49267178201449]),
            fromLonLat([118.10560969362032, 24.49239686759492]),
            fromLonLat([118.10540383184515, 24.492642853328377]),
            fromLonLat([118.10469626615779, 24.493134831577464]),
            fromLonLat([118.10428349845272, 24.493281824905605]),
            fromLonLat([118.10382171706021, 24.493006893120839]),
            fromLonLat([118.10330091495905, 24.492191040903322]),
            fromLonLat([118.10250424143378, 24.49162112563981]),
            fromLonLat([118.10237635198429, 24.492375992106368]),
            fromLonLat([118.10371300570122, 24.496254362812262]),
            fromLonLat([118.10334518115971, 24.496181379488259]),
            fromLonLat([118.10264553009672, 24.49650132011082]),
            fromLonLat([118.10194781368288, 24.49625133965597]),
            fromLonLat([118.10148600007095, 24.496246311546578]),
            fromLonLat([118.10104916410317, 24.496341262216102]),
            fromLonLat([118.10026744451947, 24.496261188108146]),
            fromLonLat([118.09993457137283, 24.496514097854607]),
            fromLonLat([118.09948868440216, 24.496180087500218]),
            fromLonLat([118.09876486283639, 24.495853015379875]),
            fromLonLat([118.09818099322881, 24.495658922305545]),
            fromLonLat([118.09765206544486, 24.495044907133771]),
            fromLonLat([118.09735810812489, 24.49482086562691]),
            fromLonLat([118.09652023719185, 24.494606675694644]),
            fromLonLat([118.0960202428043, 24.493714660862587]),
            fromLonLat([118.095552271244, 24.49335556955884]),
            fromLonLat([118.09488431041315, 24.493081383730864]),
            fromLonLat([118.09417133184392, 24.492841145069288]),
            fromLonLat([118.09370330999192, 24.492512010798151]),
            fromLonLat([118.09302831536982, 24.492473722245649]),
            fromLonLat([118.09170613807464, 24.490964336334144]),
            fromLonLat([118.09094600033232, 24.490140076125979]),
            fromLonLat([118.09016282578712, 24.489389766219539]),
            fromLonLat([118.08944268940606, 24.489138373901305]),
            fromLonLat([118.08914457763852, 24.488427314780328]),
            fromLonLat([118.08932760074433, 24.488224458816362]),
            fromLonLat([118.09003872019515, 24.488204889698736]),
            fromLonLat([118.09026275756342, 24.488084047810865]),
            fromLonLat([118.09058776476829, 24.487657296233948]),
            fromLonLat([118.09129983534638, 24.487292748824956]),
            fromLonLat([118.09178688037221, 24.487293001013672]),
            fromLonLat([118.09154282004287, 24.486886946887793]),
            fromLonLat([118.09142077160043, 24.486237001200877]),
            fromLonLat([118.09148170876597, 24.48528219751282]),
            fromLonLat([118.09121267985982, 24.48526205886855]),
            fromLonLat([118.09118769116351, 24.485457005961337]),
            fromLonLat([118.09074562896559, 24.485334784069593]),
            fromLonLat([118.08916435954279, 24.485339861071154]),
            fromLonLat([118.08906330155067, 24.484831884871589]),
            fromLonLat([118.08959140807013, 24.484833210968624]),
            fromLonLat([118.0903635126361, 24.48446772108343]),
            fromLonLat([118.09062750099717, 24.483777995758331]),
            fromLonLat([118.09144659079099, 24.483690452066377]),
            fromLonLat([118.0914165643142, 24.483363496556318]),
            fromLonLat([118.09088943305728, 24.482357389392508]),
            fromLonLat([118.0903393261772, 24.481928157925598]),
            fromLonLat([118.08976619911628, 24.481482901718209]),
            fromLonLat([118.08885499039499, 24.481144400728891]),
            fromLonLat([118.08814480077446, 24.48103895186345]),
            fromLonLat([118.0881888383546, 24.481263936318943]),
            fromLonLat([118.08774373407783, 24.481475601045492]),
            fromLonLat([118.08778375702401, 24.481639593106408]),
            fromLonLat([118.08742068769858, 24.482121255818015]),
            fromLonLat([118.08740567656858, 24.482167238126404]),
            fromLonLat([118.08730864033544, 24.482066195201423]),
            fromLonLat([118.08729663218487, 24.48186421800029]),
            fromLonLat([118.08713757864517, 24.481795115315961]),
            fromLonLat([118.08698751800617, 24.481605036795003]),
            fromLonLat([118.0866193990323, 24.481617775484089]),
            fromLonLat([118.08661839106884, 24.481511791211489]),
            fromLonLat([118.0862622621631, 24.481420539022729]),
            fromLonLat([118.08603015078839, 24.48116640190176]),
            fromLonLat([118.08578507333814, 24.481210205887749]),
            fromLonLat([118.08541691865599, 24.481028954863426]),
            fromLonLat([118.08459356432724, 24.480980293470999]),
            fromLonLat([118.083466077336, 24.481308266927098]),
            fromLonLat([118.08190021017472, 24.480735931044485]),
            fromLonLat([118.08100265211372, 24.480308136037831]),
            fromLonLat([118.07995193858414, 24.479660191542134]),
            fromLonLat([118.07941754304424, 24.479161719023541]),
            fromLonLat([118.07818355473168, 24.477699637035709]),
            fromLonLat([118.07802443456389, 24.477686460980859]),
          ],
        ]),
      }),
    },
    {
      id: "dian",
      short: "殿",
      name: "殿前街道",
      num: mapData.filter((item) => item.type == "殿前街道").length,
      lonlat: [118.1265, 24.5464],
      maskFeature: new Feature({
        geometry: new Polygon([
          [
            fromLonLat([118.11872539983362, 24.511825772492731]),
            fromLonLat([118.11850763838515, 24.511575955023819]),
            fromLonLat([118.11613729948171, 24.511583368125979]),
            fromLonLat([118.11608239110181, 24.512178313348571]),
            fromLonLat([118.11603948093094, 24.512650267632967]),
            fromLonLat([118.11586081114437, 24.514597072704039]),
            fromLonLat([118.11592776350072, 24.51492099672058]),
            fromLonLat([118.11680581737714, 24.514963501127557]),
            fromLonLat([118.11763987395069, 24.514953008104197]),
            fromLonLat([118.11835605918513, 24.514953561587653]),
            fromLonLat([118.1181164551279, 24.516584474112602]),
            fromLonLat([118.11777991465647, 24.517592541472528]),
            fromLonLat([118.11769403112916, 24.517849553236072]),
            fromLonLat([118.11763411232413, 24.518030568080608]),
            fromLonLat([118.11699590504875, 24.519091801975616]),
            fromLonLat([118.11643456684642, 24.519736026923201]),
            fromLonLat([118.11573836402009, 24.520472311094935]),
            fromLonLat([118.11455562882682, 24.521298796599137]),
            fromLonLat([118.11406813699247, 24.521649977357505]),
            fromLonLat([118.11341372178015, 24.520863384929388]),
            fromLonLat([118.11204687637806, 24.519444142873184]),
            fromLonLat([118.11155928032103, 24.519111373620202]),
            fromLonLat([118.11092679703127, 24.518802630669789]),
            fromLonLat([118.10985764580913, 24.518516009058715]),
            fromLonLat([118.10694271042703, 24.518138728830433]),
            fromLonLat([118.10319280271838, 24.517664111971687]),
            fromLonLat([118.10183239820034, 24.51757208574751]),
            fromLonLat([118.10153951475041, 24.517552069455334]),
            fromLonLat([118.10012700881771, 24.517456937418924]),
            fromLonLat([118.09919729784566, 24.517393802249337]),
            fromLonLat([118.09896136197786, 24.517377761828737]),
            fromLonLat([118.0978726195716, 24.517258558591312]),
            fromLonLat([118.09699477118686, 24.516968371549829]),
            fromLonLat([118.09606586983469, 24.516373191113946]),
            fromLonLat([118.09547689155953, 24.515733086217544]),
            fromLonLat([118.09516988241943, 24.515209053649638]),
            fromLonLat([118.09559196620869, 24.516933949087914]),
            fromLonLat([118.09585801927773, 24.5180868778885]),
            fromLonLat([118.09611505623471, 24.519047824814471]),
            fromLonLat([118.09644308137302, 24.520033787945341]),
            fromLonLat([118.09669309804354, 24.520799750783453]),
            fromLonLat([118.09688017527385, 24.522298598842447]),
            fromLonLat([118.09676220184856, 24.522394554644585]),
            fromLonLat([118.09624733170575, 24.52311629965352]),
            fromLonLat([118.09534546488477, 24.52350695036926]),
            fromLonLat([118.09592561023946, 24.52639575675386]),
            fromLonLat([118.09605366313285, 24.527352670844913]),
            fromLonLat([118.09468079528808, 24.527508178930645]),
            fromLonLat([118.09468081641452, 24.527801136522175]),
            fromLonLat([118.09639765523418, 24.527898706085942]),
            fromLonLat([118.09629162515871, 24.527409738182492]),
            fromLonLat([118.09605557399527, 24.526258813377098]),
            fromLonLat([118.09787928688985, 24.526532282382046]),
            fromLonLat([118.09852214619995, 24.526805382536182]),
            fromLonLat([118.09925194703447, 24.526610541567152]),
            fromLonLat([118.09650529290639, 24.523096379441963]),
            fromLonLat([118.09688219259685, 24.522543561058111]),
            fromLonLat([118.09699019757613, 24.522870553047845]),
            fromLonLat([118.09725717950991, 24.523291565864145]),
            fromLonLat([118.09805409157593, 24.524363607021268]),
            fromLonLat([118.09868599991262, 24.525214633956367]),
            fromLonLat([118.09961183040463, 24.526459627394679]),
            fromLonLat([118.09994874867519, 24.526916616392256]),
            fromLonLat([118.10180825877245, 24.529366481798199]),
            fromLonLat([118.10280992182, 24.530705343256823]),
            fromLonLat([118.1025710750199, 24.531335250936678]),
            fromLonLat([118.10243518199559, 24.531985167769594]),
            fromLonLat([118.10273211037713, 24.532828065624294]),
            fromLonLat([118.10306000567959, 24.53347199128828]),
            fromLonLat([118.10520110667485, 24.536441520702446]),
            fromLonLat([118.10586975750951, 24.537039379823995]),
            fromLonLat([118.10749979590818, 24.538190981874767]),
            fromLonLat([118.1101230891893, 24.541586932447544]),
            fromLonLat([118.10951562759527, 24.542285029996222]),
            fromLonLat([118.10920905947121, 24.545015792554935]),
            fromLonLat([118.1099185721678, 24.546022481681714]),
            fromLonLat([118.11022240717658, 24.546959274264509]),
            fromLonLat([118.10701996609734, 24.54996270218064]),
            fromLonLat([118.10672913102746, 24.549767766845356]),
            fromLonLat([118.10672815493803, 24.549951750581137]),
            fromLonLat([118.10605662029926, 24.550563781380127]),
            fromLonLat([118.105774797146, 24.550652807632648]),
            fromLonLat([118.10562389804268, 24.550807800792253]),
            fromLonLat([118.10551797985845, 24.551077788224902]),
            fromLonLat([118.10566090242136, 24.551171754665379]),
            fromLonLat([118.10550000828384, 24.551325758275453]),
            fromLonLat([118.10543955002665, 24.551384621976325]),
            fromLonLat([118.10558569924498, 24.551481825586524]),
            fromLonLat([118.10661293601054, 24.552075044177759]),
            fromLonLat([118.10909349915059, 24.553857567144213]),
            fromLonLat([118.11170908111467, 24.555285105227014]),
            fromLonLat([118.12278637084593, 24.557370220205904]),
            fromLonLat([118.12984425493494, 24.559143940072598]),
            fromLonLat([118.13042217690301, 24.558969718227004]),
            fromLonLat([118.13300473026089, 24.557952925535641]),
            fromLonLat([118.13670198401401, 24.556782527722525]),
            fromLonLat([118.13777493164714, 24.556299190171732]),
            fromLonLat([118.13819909621232, 24.555913674395548]),
            fromLonLat([118.13947563728031, 24.556129946470463]),
            fromLonLat([118.14010743394097, 24.556475044564223]),
            fromLonLat([118.14090987347336, 24.557021877111715]),
            fromLonLat([118.14142087658412, 24.557236132042661]),
            fromLonLat([118.14213644482874, 24.557410101364681]),
            fromLonLat([118.1443818077408, 24.557247838959945]),
            fromLonLat([118.14528788259494, 24.557110502565926]),
            fromLonLat([118.14591055023598, 24.556824581552714]),
            fromLonLat([118.14631665311995, 24.556550993141727]),
            fromLonLat([118.15143595466037, 24.550529494190979]),
            fromLonLat([118.15259025859369, 24.549516692865776]),
            fromLonLat([118.15427028651007, 24.548042029119856]),
            fromLonLat([118.15790448007371, 24.544484158067803]),
            fromLonLat([118.15866963834641, 24.544131852791068]),
            fromLonLat([118.15939189715023, 24.544007583952901]),
            fromLonLat([118.16115164708191, 24.544035431813573]),
            fromLonLat([118.16131823790059, 24.543973137501183]),
            fromLonLat([118.15988169232021, 24.543648755445986]),
            fromLonLat([118.15885613237157, 24.543302611523533]),
            fromLonLat([118.15703540439515, 24.542407916709514]),
            fromLonLat([118.15622427650517, 24.541820402434919]),
            fromLonLat([118.15522854810122, 24.540947212425003]),
            fromLonLat([118.15515271933333, 24.540866360255364]),
            fromLonLat([118.15499908051437, 24.540905609395736]),
            fromLonLat([118.15491526212138, 24.540853767753152]),
            fromLonLat([118.15419086475801, 24.539599144399812]),
            fromLonLat([118.15380472585647, 24.539295838095658]),
            fromLonLat([118.15360018618702, 24.539136199102806]),
            fromLonLat([118.15177728215984, 24.538136360793565]),
            fromLonLat([118.15016287911644, 24.537497085112491]),
            fromLonLat([118.14877092655566, 24.536964382076047]),
            fromLonLat([118.14733502260817, 24.536414707493368]),
            fromLonLat([118.14527738137222, 24.53577994810842]),
            fromLonLat([118.14433633838115, 24.535490387356969]),
            fromLonLat([118.14195217147264, 24.534656964806786]),
            fromLonLat([118.13960577855025, 24.533691355168212]),
            fromLonLat([118.13847491818497, 24.532990970118256]),
            fromLonLat([118.13781114897307, 24.532487909207745]),
            fromLonLat([118.13532061912544, 24.530431339811528]),
            fromLonLat([118.13405581956175, 24.529437005643473]),
            fromLonLat([118.13073933703815, 24.526831144038926]),
            fromLonLat([118.12899609837129, 24.52580412627054]),
            fromLonLat([118.12822828674081, 24.525460955695401]),
            fromLonLat([118.12722383132463, 24.525338960024605]),
            fromLonLat([118.12533470897354, 24.526188610954232]),
            fromLonLat([118.12305001092376, 24.527348425299504]),
            fromLonLat([118.12325767465835, 24.526760330124571]),
            fromLonLat([118.12371699830102, 24.526035048317141]),
            fromLonLat([118.12412438980313, 24.525493773038836]),
            fromLonLat([118.12432408904075, 24.525227631163023]),
            fromLonLat([118.12501205103416, 24.524453135569221]),
            fromLonLat([118.12562311341308, 24.523765683615771]),
            fromLonLat([118.12594161315496, 24.523466425695108]),
            fromLonLat([118.12668144460142, 24.522430872187595]),
            fromLonLat([118.1295016816093, 24.51752774363851]),
            fromLonLat([118.12969435343027, 24.51715659591304]),
            fromLonLat([118.13022042298127, 24.516141179789603]),
            fromLonLat([118.13067364627388, 24.51572475134375]),
            fromLonLat([118.13051290485285, 24.515625937694352]),
            fromLonLat([118.13248547982836, 24.51423094120624]),
            fromLonLat([118.13228270825574, 24.512706392421425]),
            fromLonLat([118.1337091474027, 24.511435923266564]),
            fromLonLat([118.13293735872655, 24.509504114461198]),
            fromLonLat([118.13128809426082, 24.508530130477819]),
            fromLonLat([118.12777578742819, 24.508743784701572]),
            fromLonLat([118.1272675377809, 24.508443331099517]),
            fromLonLat([118.1265766215644, 24.508812935337311]),
            fromLonLat([118.12607035719618, 24.508535445358188]),
            fromLonLat([118.12519559955814, 24.507984334409141]),
            fromLonLat([118.12451856779727, 24.50793793885822]),
            fromLonLat([118.12439972840588, 24.507826056688188]),
            fromLonLat([118.12441566621546, 24.507276124366779]),
            fromLonLat([118.12422389975406, 24.506893350053293]),
            fromLonLat([118.12329318003717, 24.506552189870064]),
            fromLonLat([118.12315635874187, 24.506431318433986]),
            fromLonLat([118.12261209388009, 24.506391765113932]),
            fromLonLat([118.12162146605182, 24.507363393164692]),
            fromLonLat([118.12119105393631, 24.507784653561995]),
            fromLonLat([118.12070872133357, 24.508363924529032]),
            fromLonLat([118.12065978793758, 24.508428951745699]),
            fromLonLat([118.11990281828997, 24.509612308830221]),
            fromLonLat([118.11977399410375, 24.509853367568269]),
            fromLonLat([118.11940248748908, 24.510552513165646]),
            fromLonLat([118.11934757138162, 24.510655537270686]),
            fromLonLat([118.11872539983362, 24.511825772492731]),
          ],
        ]),
      }),
    },
    {
      id: "jiang",
      short: "江",
      name: "江头街道",
      num: mapData.filter((item) => item.type == "江头街道").length,
      lonlat: [118.1365, 24.5054],
      maskFeature: new Feature({
        geometry: new Polygon([
          [
            fromLonLat([118.16304452907768, 24.495125832888512]),
            fromLonLat([118.16366499199006, 24.495066707981696]),
            fromLonLat([118.16441812437307, 24.494738383669105]),
            fromLonLat([118.16493480892048, 24.494178522838645]),
            fromLonLat([118.16513325489166, 24.493430284202056]),
            fromLonLat([118.16496562341564, 24.492647725880314]),
            fromLonLat([118.16476509112501, 24.49240013097452]),
            fromLonLat([118.16461346637998, 24.492273428299271]),
            fromLonLat([118.16421544445234, 24.492226166459965]),
            fromLonLat([118.16383735753354, 24.491978905513843]),
            fromLonLat([118.16379942504319, 24.491618037371346]),
            fromLonLat([118.16352906050123, 24.491211601243727]),
            fromLonLat([118.16348215477576, 24.490918729720484]),
            fromLonLat([118.16313498784059, 24.49065541215786]),
            fromLonLat([118.16299630298681, 24.490308725817492]),
            fromLonLat([118.16284664271116, 24.489933053632043]),
            fromLonLat([118.16269300776079, 24.48977936588232]),
            fromLonLat([118.1624934142132, 24.488636917523312]),
            fromLonLat([118.16239962234928, 24.488482120864759]),
            fromLonLat([118.16364262116802, 24.488967773006717]),
            fromLonLat([118.16436388232056, 24.489478355327037]),
            fromLonLat([118.16538439203424, 24.489909402307735]),
            fromLonLat([118.16611064375185, 24.490776921768163]),
            fromLonLat([118.16659351017941, 24.491560891820143]),
            fromLonLat([118.16664739061716, 24.491762762428852]),
            fromLonLat([118.16775063780779, 24.491701717516367]),
            fromLonLat([118.16780937665139, 24.490236851731446]),
            fromLonLat([118.1677594999333, 24.490079967820716]),
            fromLonLat([118.16777344378582, 24.489920965162398]),
            fromLonLat([118.16786223144713, 24.489910800963699]),
            fromLonLat([118.16788515644532, 24.489661804803024]),
            fromLonLat([118.1690931368431, 24.489678542560299]),
            fromLonLat([118.16957291688884, 24.489432678713406]),
            fromLonLat([118.16993399915769, 24.489406014382329]),
            fromLonLat([118.17196093238796, 24.489691142920584]),
            fromLonLat([118.17327859739605, 24.489512677484221]),
            fromLonLat([118.17375639737661, 24.489735739840864]),
            fromLonLat([118.17497830786635, 24.489546451565463]),
            fromLonLat([118.17484555906701, 24.488364908064426]),
            fromLonLat([118.17446851951348, 24.488477606230983]),
            fromLonLat([118.17311585887214, 24.487420345973355]),
            fromLonLat([118.17280364337687, 24.487377943063809]),
            fromLonLat([118.17258119022894, 24.487180393331794]),
            fromLonLat([118.17230089788634, 24.48719592089499]),
            fromLonLat([118.17193882853967, 24.487453566451396]),
            fromLonLat([118.17175235432416, 24.488240781289999]),
            fromLonLat([118.1711598371744, 24.488120917022144]),
            fromLonLat([118.17076779640713, 24.487886700706735]),
            fromLonLat([118.17080369701968, 24.487758652159915]),
            fromLonLat([118.16999469959835, 24.487342246713148]),
            fromLonLat([118.16931041006616, 24.487121564716347]),
            fromLonLat([118.1689074037855, 24.486901363209636]),
            fromLonLat([118.16845549677109, 24.486373298481883]),
            fromLonLat([118.16809442340472, 24.486712912419179]),
            fromLonLat([118.16792582727302, 24.486472273424855]),
            fromLonLat([118.16738315261047, 24.486073355561029]),
            fromLonLat([118.16711583837656, 24.486349801674802]),
            fromLonLat([118.16613524166809, 24.485860706461757]),
            fromLonLat([118.16535027470032, 24.487083954523825]),
            fromLonLat([118.16518567925921, 24.487046263927404]),
            fromLonLat([118.16483249479766, 24.486242045653899]),
            fromLonLat([118.16431375263734, 24.486073035056524]),
            fromLonLat([118.16441348299178, 24.485599933280458]),
            fromLonLat([118.16379200790523, 24.485664063564673]),
            fromLonLat([118.16262986671352, 24.485784156335153]),
            fromLonLat([118.162085056183, 24.483667517313361]),
            fromLonLat([118.16183964387446, 24.483519984354515]),
            fromLonLat([118.16082804792342, 24.482907922694185]),
            fromLonLat([118.16089687489418, 24.482680833922824]),
            fromLonLat([118.16063150053711, 24.482441357559949]),
            fromLonLat([118.16054168977905, 24.482188557724854]),
            fromLonLat([118.16002894703216, 24.482310456832838]),
            fromLonLat([118.15890664370875, 24.4822944562125]),
            fromLonLat([118.15890766193283, 24.482583399830141]),
            fromLonLat([118.15765364686816, 24.482485635113264]),
            fromLonLat([118.15762371962882, 24.482648652445608]),
            fromLonLat([118.15715084495402, 24.48256249288001]),
            fromLonLat([118.15707602237923, 24.482706601238565]),
            fromLonLat([118.15646944823372, 24.482475702066758]),
            fromLonLat([118.15653925317167, 24.482188625248448]),
            fromLonLat([118.15633473362581, 24.482169982837636]),
            fromLonLat([118.15455494806217, 24.482770937793493]),
            fromLonLat([118.15399722444236, 24.482551918544228]),
            fromLonLat([118.15302243091662, 24.482169629330979]),
            fromLonLat([118.15249663757517, 24.482088520139019]),
            fromLonLat([118.15135620850035, 24.481842454990069]),
            fromLonLat([118.14997728788069, 24.481656730596733]),
            fromLonLat([118.14962007025792, 24.481490342086648]),
            fromLonLat([118.14931472945899, 24.481246869852566]),
            fromLonLat([118.14839669850666, 24.480516464675691]),
            fromLonLat([118.14801455526977, 24.480812011295388]),
            fromLonLat([118.14704565797679, 24.480811524927805]),
            fromLonLat([118.14500597213996, 24.480314727683492]),
            fromLonLat([118.14457290559335, 24.480646314453669]),
            fromLonLat([118.14396118690939, 24.480854190271977]),
            fromLonLat([118.14462799497841, 24.483501730490907]),
            fromLonLat([118.1448116617055, 24.484229334450085]),
            fromLonLat([118.14526380746476, 24.485602415951295]),
            fromLonLat([118.14565723433131, 24.489230197983396]),
            fromLonLat([118.14574010345881, 24.489859969207]),
            fromLonLat([118.14484400624578, 24.489979294591617]),
            fromLonLat([118.1435976217477, 24.490345089908626]),
            fromLonLat([118.14353975327805, 24.490371170987295]),
            fromLonLat([118.14167961058935, 24.491216710545761]),
            fromLonLat([118.1407714478654, 24.491628917334769]),
            fromLonLat([118.13903691126119, 24.492321172762992]),
            fromLonLat([118.13887023404467, 24.492328395586455]),
            fromLonLat([118.13879536873831, 24.492331495434541]),
            fromLonLat([118.13784719621597, 24.492370746110034]),
            fromLonLat([118.13759966583454, 24.492378068752249]),
            fromLonLat([118.13667340452227, 24.492387262742238]),
            fromLonLat([118.13666342310205, 24.492387275482738]),
            fromLonLat([118.13469701512784, 24.492325735976763]),
            fromLonLat([118.13459819226887, 24.492322856471585]),
            fromLonLat([118.13416096192279, 24.492308386186775]),
            fromLonLat([118.13283228892124, 24.492095993335916]),
            fromLonLat([118.13215444735746, 24.491987786379021]),
            fromLonLat([118.13138971423412, 24.49171869451299]),
            fromLonLat([118.1312958794833, 24.491685803380573]),
            fromLonLat([118.13097241221823, 24.49157217648235]),
            fromLonLat([118.13054110475341, 24.491254702777358]),
            fromLonLat([118.1304412641465, 24.491181821331821]),
            fromLonLat([118.13021861540146, 24.490979090402249]),
            fromLonLat([118.12998198678113, 24.4907643844749]),
            fromLonLat([118.12943483757371, 24.490267044384289]),
            fromLonLat([118.12898053561827, 24.48985458638305]),
            fromLonLat([118.12891863030664, 24.489800658006981]),
            fromLonLat([118.12871194988239, 24.489682887022155]),
            fromLonLat([118.12840643254718, 24.489692195842022]),
            fromLonLat([118.12822073890942, 24.489902351851672]),
            fromLonLat([118.12800013588428, 24.490634444924975]),
            fromLonLat([118.12795422486401, 24.490878454905232]),
            fromLonLat([118.12784043564757, 24.491491458374799]),
            fromLonLat([118.12772765337893, 24.492090472792849]),
            fromLonLat([118.12764681897045, 24.492517480570807]),
            fromLonLat([118.12740228291725, 24.493736514465379]),
            fromLonLat([118.12725456183793, 24.494469543226497]),
            fromLonLat([118.12710883638401, 24.495195560811691]),
            fromLonLat([118.12696311414449, 24.495977580243789]),
            fromLonLat([118.12690820839873, 24.496269581666365]),
            fromLonLat([118.12684632604223, 24.49660258396349]),
            fromLonLat([118.12681240029177, 24.49678259105216]),
            fromLonLat([118.12674652545942, 24.497139593742105]),
            fromLonLat([118.12668564085637, 24.497467595717495]),
            fromLonLat([118.12666368249096, 24.497586599930852]),
            fromLonLat([118.12657385198729, 24.49806460836195]),
            fromLonLat([118.12642413424696, 24.498867618059609]),
            fromLonLat([118.12641814515155, 24.498894619952843]),
            fromLonLat([118.12616660354594, 24.500051675796737]),
            fromLonLat([118.12608275582441, 24.500437690819762]),
            fromLonLat([118.12584817005875, 24.501512740927968]),
            fromLonLat([118.12577130857656, 24.501864753743639]),
            fromLonLat([118.12566350263863, 24.502360775280511]),
            fromLonLat([118.12564255027391, 24.502456781442522]),
            fromLonLat([118.12554772050352, 24.502892799044261]),
            fromLonLat([118.12518131894846, 24.503799988004243]),
            fromLonLat([118.12462915352438, 24.504510362338191]),
            fromLonLat([118.12437554550748, 24.504810533355418]),
            fromLonLat([118.12397812073601, 24.505166827550898]),
            fromLonLat([118.12261209388009, 24.506391765113932]),
            fromLonLat([118.12315635874187, 24.506431318433986]),
            fromLonLat([118.12329318003717, 24.506552189870064]),
            fromLonLat([118.12422389975406, 24.506893350053293]),
            fromLonLat([118.12441566621546, 24.507276124366779]),
            fromLonLat([118.12439972840588, 24.507826056688188]),
            fromLonLat([118.12451856779727, 24.50793793885822]),
            fromLonLat([118.12519559955814, 24.507984334409141]),
            fromLonLat([118.12607035719618, 24.508535445358188]),
            fromLonLat([118.1265766215644, 24.508812935337311]),
            fromLonLat([118.1272675377809, 24.508443331099517]),
            fromLonLat([118.12777578742819, 24.508743784701572]),
            fromLonLat([118.13128809426082, 24.508530130477819]),
            fromLonLat([118.13293735872655, 24.509504114461198]),
            fromLonLat([118.13355434265506, 24.510362262488609]),
            fromLonLat([118.13493891060125, 24.510836527370703]),
            fromLonLat([118.13547395346927, 24.511019844836206]),
            fromLonLat([118.135591749412, 24.511170679418068]),
            fromLonLat([118.13592213175176, 24.51099728868574]),
            fromLonLat([118.13640322599255, 24.510745723739984]),
            fromLonLat([118.13660584224753, 24.510639479571864]),
            fromLonLat([118.13669668431908, 24.510933316389782]),
            fromLonLat([118.13702000565912, 24.509893054143781]),
            fromLonLat([118.13734038017694, 24.509422720478049]),
            fromLonLat([118.13745704940531, 24.507880797773414]),
            fromLonLat([118.13742404983068, 24.507159944360865]),
            fromLonLat([118.13748486465549, 24.506041041767336]),
            fromLonLat([118.13842806372112, 24.506090795466005]),
            fromLonLat([118.13856083365769, 24.506435563648115]),
            fromLonLat([118.13873750540699, 24.506459324784519]),
            fromLonLat([118.1391047940992, 24.506438834515272]),
            fromLonLat([118.13997111390225, 24.506583637765814]),
            fromLonLat([118.1415330050657, 24.506525469650864]),
            fromLonLat([118.14255893270737, 24.506601994899963]),
            fromLonLat([118.14261374530153, 24.505550074064487]),
            fromLonLat([118.14901215087534, 24.505696322432289]),
            fromLonLat([118.14890823802224, 24.503856761981119]),
            fromLonLat([118.14875541869466, 24.501545366282127]),
            fromLonLat([118.14869047067138, 24.500278672192874]),
            fromLonLat([118.14858060232038, 24.498888067946215]),
            fromLonLat([118.14856762625543, 24.498685126611626]),
            fromLonLat([118.14802965586492, 24.49662130418038]),
            fromLonLat([118.14787297031697, 24.496241613853694]),
            fromLonLat([118.14961909118983, 24.495842905622954]),
            fromLonLat([118.15319693501949, 24.494797192365471]),
            fromLonLat([118.15290754274363, 24.493877828559334]),
            fromLonLat([118.1519774518207, 24.490916864777677]),
            fromLonLat([118.15179382653342, 24.490331274135492]),
            fromLonLat([118.15297413499339, 24.49031531339191]),
            fromLonLat([118.15431703887663, 24.490298050941082]),
            fromLonLat([118.15446768935688, 24.490295795165405]),
            fromLonLat([118.15492063600185, 24.49029002361895]),
            fromLonLat([118.15525286738786, 24.490375442310789]),
            fromLonLat([118.15681030415435, 24.491699528311226]),
            fromLonLat([118.15713851311611, 24.491631966127017]),
            fromLonLat([118.1572711915841, 24.491530749137993]),
            fromLonLat([118.15725122573434, 24.491346810794557]),
            fromLonLat([118.15752658424518, 24.491369325858447]),
            fromLonLat([118.15871174724353, 24.491199274615319]),
            fromLonLat([118.15883246122668, 24.491380024667414]),
            fromLonLat([118.15856013738779, 24.491584476529834]),
            fromLonLat([118.1585691249865, 24.491711442199271]),
            fromLonLat([118.15898217754743, 24.492288607558418]),
            fromLonLat([118.15915078299095, 24.4924252887248]),
            fromLonLat([118.15960171114864, 24.492587463524494]),
            fromLonLat([118.15999778512166, 24.492979690442461]),
            fromLonLat([118.16037787648268, 24.493105992299185]),
            fromLonLat([118.16104530465498, 24.49372668466939]),
            fromLonLat([118.16147029096271, 24.493985881511559]),
            fromLonLat([118.16214665353803, 24.494127627599951]),
            fromLonLat([118.16226138342014, 24.494266399680562]),
            fromLonLat([118.16231726824692, 24.494564245779529]),
            fromLonLat([118.16275023823282, 24.494963402037808]),
            fromLonLat([118.16304452907768, 24.495125832888512]),
          ],
        ]),
      }),
    },
    {
      id: "he",
      short: "禾",
      name: "禾山街道",
      num: mapData.filter((item) => item.type == "禾山街道").length,
      lonlat: [118.1565, 24.5254],
      maskFeature: new Feature({
        geometry: new Polygon([
          [
            fromLonLat([118.16318796162314, 24.506095842693558]),
            fromLonLat([118.16288467162889, 24.505629466945891]),
            fromLonLat([118.15999873464442, 24.506284568396143]),
            fromLonLat([118.15989091528388, 24.505175936869975]),
            fromLonLat([118.1562276423505, 24.505173380132543]),
            fromLonLat([118.15553226784131, 24.505227562637913]),
            fromLonLat([118.15512322591906, 24.505260260246089]),
            fromLonLat([118.15470921417355, 24.505455941971046]),
            fromLonLat([118.1542522658351, 24.505471717381365]),
            fromLonLat([118.1538521882752, 24.505292418750969]),
            fromLonLat([118.15195949643532, 24.505063625302846]),
            fromLonLat([118.1513309314807, 24.505088658423521]),
            fromLonLat([118.1508550049264, 24.505108435353712]),
            fromLonLat([118.14962278865914, 24.5055443646601]),
            fromLonLat([118.14920173266464, 24.50570200896205]),
            fromLonLat([118.14901215087534, 24.505696322432289]),
            fromLonLat([118.14261374530153, 24.505550074064487]),
            fromLonLat([118.14255893270737, 24.506601994899963]),
            fromLonLat([118.1415330050657, 24.506525469650864]),
            fromLonLat([118.13997111390225, 24.506583637765814]),
            fromLonLat([118.1391047940992, 24.506438834515272]),
            fromLonLat([118.13873750540699, 24.506459324784519]),
            fromLonLat([118.13856083365769, 24.506435563648115]),
            fromLonLat([118.13842806372112, 24.506090795466005]),
            fromLonLat([118.13748486465549, 24.506041041767336]),
            fromLonLat([118.13742404983068, 24.507159944360865]),
            fromLonLat([118.13745704940531, 24.507880797773414]),
            fromLonLat([118.13734038017694, 24.509422720478049]),
            fromLonLat([118.13702000565912, 24.509893054143781]),
            fromLonLat([118.13669668431908, 24.510933316389782]),
            fromLonLat([118.13660584224753, 24.510639479571864]),
            fromLonLat([118.13640322599255, 24.510745723739984]),
            fromLonLat([118.13592213175176, 24.51099728868574]),
            fromLonLat([118.135591749412, 24.511170679418068]),
            fromLonLat([118.13547395346927, 24.511019844836206]),
            fromLonLat([118.13493891060125, 24.510836527370703]),
            fromLonLat([118.13355434265506, 24.510362262488609]),
            fromLonLat([118.13293735872655, 24.509504114461198]),
            fromLonLat([118.1337091474027, 24.511435923266564]),
            fromLonLat([118.13228270825574, 24.512706392421425]),
            fromLonLat([118.13248547982836, 24.51423094120624]),
            fromLonLat([118.13051290485285, 24.515625937694352]),
            fromLonLat([118.13067364627388, 24.51572475134375]),
            fromLonLat([118.13022042298127, 24.516141179789603]),
            fromLonLat([118.12969435343027, 24.51715659591304]),
            fromLonLat([118.1295016816093, 24.51752774363851]),
            fromLonLat([118.12668144460142, 24.522430872187595]),
            fromLonLat([118.12594161315496, 24.523466425695108]),
            fromLonLat([118.12562311341308, 24.523765683615771]),
            fromLonLat([118.12501205103416, 24.524453135569221]),
            fromLonLat([118.12432408904075, 24.525227631163023]),
            fromLonLat([118.12412438980313, 24.525493773038836]),
            fromLonLat([118.12371699830102, 24.526035048317141]),
            fromLonLat([118.12325767465835, 24.526760330124571]),
            fromLonLat([118.12305001092376, 24.527348425299504]),
            fromLonLat([118.12533470897354, 24.526188610954232]),
            fromLonLat([118.12722282286497, 24.525338961001264]),
            fromLonLat([118.12822828674081, 24.525460955695401]),
            fromLonLat([118.12899609837129, 24.52580412627054]),
            fromLonLat([118.13073933703815, 24.526831144038926]),
            fromLonLat([118.13405581956175, 24.529437005643473]),
            fromLonLat([118.13532061912544, 24.530431339811528]),
            fromLonLat([118.13781114897307, 24.532487909207745]),
            fromLonLat([118.13847491818497, 24.532990970118256]),
            fromLonLat([118.13960577855025, 24.533691355168212]),
            fromLonLat([118.14195217147264, 24.534656964806786]),
            fromLonLat([118.14433633838115, 24.535490387356969]),
            fromLonLat([118.14527738137222, 24.53577994810842]),
            fromLonLat([118.14733502260817, 24.536414707493368]),
            fromLonLat([118.14877092655566, 24.536964382076047]),
            fromLonLat([118.15016287911644, 24.537497085112491]),
            fromLonLat([118.15177728215984, 24.538136360793565]),
            fromLonLat([118.15360018618702, 24.539136199102806]),
            fromLonLat([118.15380472585647, 24.539295838095658]),
            fromLonLat([118.15419086475801, 24.539599144399812]),
            fromLonLat([118.15491526212138, 24.540853767753152]),
            fromLonLat([118.15499908051437, 24.540905609395736]),
            fromLonLat([118.15515271933333, 24.540866360255364]),
            fromLonLat([118.15522854810122, 24.540947212425003]),
            fromLonLat([118.15622427650517, 24.541820402434919]),
            fromLonLat([118.15703540439515, 24.542407916709514]),
            fromLonLat([118.15885613237157, 24.543302611523533]),
            fromLonLat([118.15988169232021, 24.543648755445986]),
            fromLonLat([118.16131823790059, 24.543973137501183]),
            fromLonLat([118.16115164708191, 24.544035431813573]),
            fromLonLat([118.15939189715023, 24.544007583952901]),
            fromLonLat([118.16146191542219, 24.544487819731831]),
            fromLonLat([118.16233681392717, 24.544787197997326]),
            fromLonLat([118.16410549635054, 24.545096931411464]),
            fromLonLat([118.16793187598172, 24.543359051150581]),
            fromLonLat([118.16892237617198, 24.543047238515801]),
            fromLonLat([118.16953082214286, 24.542642146328845]),
            fromLonLat([118.16974626798658, 24.542451760081271]),
            fromLonLat([118.16981907352901, 24.542287639102994]),
            fromLonLat([118.17010733870784, 24.542133122220243]),
            fromLonLat([118.17573796919866, 24.539775755641298]),
            fromLonLat([118.17562024804872, 24.539513004926441]),
            fromLonLat([118.17942452302877, 24.537942985107026]),
            fromLonLat([118.17952428934595, 24.538196760647306]),
            fromLonLat([118.180298315692, 24.537897335017647]),
            fromLonLat([118.18055760880472, 24.537148929820482]),
            fromLonLat([118.18022142405307, 24.536697621715103]),
            fromLonLat([118.18039192983169, 24.535934396838087]),
            fromLonLat([118.18029412675442, 24.535097687864219]),
            fromLonLat([118.17982817045528, 24.533254801680254]),
            fromLonLat([118.18014625470022, 24.531801382904817]),
            fromLonLat([118.18200734185744, 24.528472294704638]),
            fromLonLat([118.18220272815425, 24.526749156319784]),
            fromLonLat([118.18203211492013, 24.52615955383158]),
            fromLonLat([118.18215378543145, 24.525826371623815]),
            fromLonLat([118.18200407168888, 24.524702800554735]),
            fromLonLat([118.18181454369615, 24.524640165277553]),
            fromLonLat([118.18157815735003, 24.524768596999923]),
            fromLonLat([118.18129983320829, 24.52442517159934]),
            fromLonLat([118.17972266880879, 24.522478418040198]),
            fromLonLat([118.17930069725654, 24.521969286327394]),
            fromLonLat([118.17859138630342, 24.520541827259699]),
            fromLonLat([118.17835795772415, 24.520287309803408]),
            fromLonLat([118.17686269638769, 24.519730222307935]),
            fromLonLat([118.17615049139232, 24.519656582503874]),
            fromLonLat([118.1759699187534, 24.51938896677078]),
            fromLonLat([118.17587213222261, 24.518916218359433]),
            fromLonLat([118.17529846313326, 24.517246546381514]),
            fromLonLat([118.17504708755182, 24.516954058430397]),
            fromLonLat([118.17448848181419, 24.516713156734816]),
            fromLonLat([118.17309100259806, 24.516603817063178]),
            fromLonLat([118.172824657268, 24.516361350375348]),
            fromLonLat([118.1726281320021, 24.51606776771434]),
            fromLonLat([118.1724964197832, 24.515446102511252]),
            fromLonLat([118.17249635737367, 24.514569230122479]),
            fromLonLat([118.17234870611134, 24.51423955983843]),
            fromLonLat([118.17161950826103, 24.513886990643556]),
            fromLonLat([118.17041256504758, 24.514036236888707]),
            fromLonLat([118.16982103546084, 24.513826385084723]),
            fromLonLat([118.16954171537368, 24.513674928382436]),
            fromLonLat([118.16890027231879, 24.512828256495251]),
            fromLonLat([118.16807929625257, 24.512415853778236]),
            fromLonLat([118.16738696651581, 24.511749238921823]),
            fromLonLat([118.16697198506145, 24.511534048451729]),
            fromLonLat([118.16636944098846, 24.510795270960589]),
            fromLonLat([118.16610207960397, 24.510579803933958]),
            fromLonLat([118.16578582710066, 24.509920483325494]),
            fromLonLat([118.16530996692917, 24.509374442471582]),
            fromLonLat([118.1646296001017, 24.508695803287281]),
            fromLonLat([118.16412479263136, 24.507965844835507]),
            fromLonLat([118.16366087871373, 24.507190805401638]),
            fromLonLat([118.16318796162314, 24.506095842693558]),
          ],
        ]),
      }),
    },
    {
      id: "jin",
      short: "金",
      name: "金山街道",
      num: mapData.filter((item) => item.type == "金山街道").length,
      lonlat: [118.1765, 24.5054],
      maskFeature: new Feature({
        geometry: new Polygon([
          [
            fromLonLat([118.17493670283952, 24.49361484914894]),
            fromLonLat([118.17478406355491, 24.493265198798269]),
            fromLonLat([118.17485581175661, 24.492275225484526]),
            fromLonLat([118.17495048024972, 24.490979264254243]),
            fromLonLat([118.17503319113494, 24.489854302167188]),
            fromLonLat([118.17497830786635, 24.489546451565463]),
            fromLonLat([118.17375639737661, 24.489735739840864]),
            fromLonLat([118.17327859739605, 24.489512677484221]),
            fromLonLat([118.17196093238796, 24.489691142920584]),
            fromLonLat([118.16993399915769, 24.489406014382329]),
            fromLonLat([118.16957291688884, 24.489432678713406]),
            fromLonLat([118.1690931368431, 24.489678542560299]),
            fromLonLat([118.16788515644532, 24.489661804803024]),
            fromLonLat([118.16786223144713, 24.489910800963699]),
            fromLonLat([118.16777344378582, 24.489920965162398]),
            fromLonLat([118.1677594999333, 24.490079967820716]),
            fromLonLat([118.16780937665139, 24.490236851731446]),
            fromLonLat([118.16775063780779, 24.491701717516367]),
            fromLonLat([118.16664739061716, 24.491762762428852]),
            fromLonLat([118.16659351017941, 24.491560891820143]),
            fromLonLat([118.16611064375185, 24.490776921768163]),
            fromLonLat([118.16538439203424, 24.489909402307735]),
            fromLonLat([118.16436388232056, 24.489478355327037]),
            fromLonLat([118.16364262116802, 24.488967773006717]),
            fromLonLat([118.16239962234928, 24.488482120864759]),
            fromLonLat([118.1624934142132, 24.488636917523312]),
            fromLonLat([118.16269300776079, 24.48977936588232]),
            fromLonLat([118.16284664271116, 24.489933053632043]),
            fromLonLat([118.16299630298681, 24.490308725817492]),
            fromLonLat([118.16313498784059, 24.49065541215786]),
            fromLonLat([118.16348215477576, 24.490918729720484]),
            fromLonLat([118.16352906050123, 24.491211601243727]),
            fromLonLat([118.16379942504319, 24.491618037371346]),
            fromLonLat([118.16383735753354, 24.491978905513843]),
            fromLonLat([118.16421544445234, 24.492226166459965]),
            fromLonLat([118.16461346637998, 24.492273428299271]),
            fromLonLat([118.16476509112501, 24.49240013097452]),
            fromLonLat([118.16496562341564, 24.492647725880314]),
            fromLonLat([118.16513325489166, 24.493430284202056]),
            fromLonLat([118.16493480892048, 24.494178522838645]),
            fromLonLat([118.16441812437307, 24.494738383669105]),
            fromLonLat([118.16366499199006, 24.495066707981696]),
            fromLonLat([118.16304452907768, 24.495125832888512]),
            fromLonLat([118.16275023823282, 24.494963402037808]),
            fromLonLat([118.16231726824692, 24.494564245779529]),
            fromLonLat([118.16226237100877, 24.494266397888879]),
            fromLonLat([118.16214665353803, 24.494127627599951]),
            fromLonLat([118.16147029096271, 24.493985881511559]),
            fromLonLat([118.16104530465498, 24.49372668466939]),
            fromLonLat([118.16037787648268, 24.493105992299185]),
            fromLonLat([118.15999778512166, 24.492979690442461]),
            fromLonLat([118.15960171114864, 24.492587463524494]),
            fromLonLat([118.15915078299095, 24.4924252887248]),
            fromLonLat([118.15898217754743, 24.492288607558418]),
            fromLonLat([118.1585691249865, 24.491711442199271]),
            fromLonLat([118.15856013738779, 24.491584476529834]),
            fromLonLat([118.15883246122668, 24.491380024667414]),
            fromLonLat([118.15871174724353, 24.491199274615319]),
            fromLonLat([118.15752658424518, 24.491369325858447]),
            fromLonLat([118.15725122573434, 24.491346810794557]),
            fromLonLat([118.1572711915841, 24.491530749137993]),
            fromLonLat([118.15713851311611, 24.491631966127017]),
            fromLonLat([118.15681030415435, 24.491699528311226]),
            fromLonLat([118.15525286738786, 24.490375442310789]),
            fromLonLat([118.15492063600185, 24.49029002361895]),
            fromLonLat([118.15446768935688, 24.490295795165405]),
            fromLonLat([118.15431703887663, 24.490298050941082]),
            fromLonLat([118.15297413499339, 24.49031531339191]),
            fromLonLat([118.15179382653342, 24.490331274135492]),
            fromLonLat([118.1519774518207, 24.490916864777677]),
            fromLonLat([118.15290754274363, 24.493877828559334]),
            fromLonLat([118.15319693501949, 24.494797192365471]),
            fromLonLat([118.14961909118983, 24.495842905622954]),
            fromLonLat([118.14787297031697, 24.496241613853694]),
            fromLonLat([118.14802965586492, 24.49662130418038]),
            fromLonLat([118.14856762625543, 24.498685126611626]),
            fromLonLat([118.14858060232038, 24.498888067946215]),
            fromLonLat([118.14869047067138, 24.500278672192874]),
            fromLonLat([118.14875541869466, 24.501545366282127]),
            fromLonLat([118.14890823802224, 24.503856761981119]),
            fromLonLat([118.14901215087534, 24.505696322432289]),
            fromLonLat([118.14920173266464, 24.50570200896205]),
            fromLonLat([118.14962278865914, 24.5055443646601]),
            fromLonLat([118.1508550049264, 24.505108435353712]),
            fromLonLat([118.1513309314807, 24.505088658423521]),
            fromLonLat([118.15195949643532, 24.505063625302846]),
            fromLonLat([118.1538521882752, 24.505292418750969]),
            fromLonLat([118.1542522658351, 24.505471717381365]),
            fromLonLat([118.15470921417355, 24.505455941971046]),
            fromLonLat([118.15512322591906, 24.505260260246089]),
            fromLonLat([118.15553226784131, 24.505227562637913]),
            fromLonLat([118.1562276423505, 24.505173380132543]),
            fromLonLat([118.15989091528388, 24.505175936869975]),
            fromLonLat([118.15999873464442, 24.506284568396143]),
            fromLonLat([118.16288467162889, 24.505629466945891]),
            fromLonLat([118.16318796162314, 24.506095842693558]),
            fromLonLat([118.16366087871373, 24.507190805401638]),
            fromLonLat([118.16412479263136, 24.507965844835507]),
            fromLonLat([118.1646296001017, 24.508695803287281]),
            fromLonLat([118.16530996692917, 24.509374442471582]),
            fromLonLat([118.16578582710066, 24.509920483325494]),
            fromLonLat([118.16610207960397, 24.510579803933958]),
            fromLonLat([118.16636944098846, 24.510795270960589]),
            fromLonLat([118.16697198506145, 24.511534048451729]),
            fromLonLat([118.16738696651581, 24.511749238921823]),
            fromLonLat([118.16807929625257, 24.512415853778236]),
            fromLonLat([118.16890027231879, 24.512828256495251]),
            fromLonLat([118.16954171537368, 24.513674928382436]),
            fromLonLat([118.16982103546084, 24.513826385084723]),
            fromLonLat([118.17041256504758, 24.514036236888707]),
            fromLonLat([118.17161950826103, 24.513886990643556]),
            fromLonLat([118.17234870611134, 24.51423955983843]),
            fromLonLat([118.17249635737367, 24.514569230122479]),
            fromLonLat([118.1724964197832, 24.515446102511252]),
            fromLonLat([118.1726281320021, 24.51606776771434]),
            fromLonLat([118.172824657268, 24.516361350375348]),
            fromLonLat([118.17309100259806, 24.516603817063178]),
            fromLonLat([118.17448848181419, 24.516713156734816]),
            fromLonLat([118.17504708755182, 24.516954058430397]),
            fromLonLat([118.17529846313326, 24.517246546381514]),
            fromLonLat([118.17587213222261, 24.518916218359433]),
            fromLonLat([118.1759699187534, 24.51938896677078]),
            fromLonLat([118.17615049139232, 24.519656582503874]),
            fromLonLat([118.17686269638769, 24.519730222307935]),
            fromLonLat([118.17835795772415, 24.520287309803408]),
            fromLonLat([118.17859138630342, 24.520541827259699]),
            fromLonLat([118.17930069725654, 24.521969286327394]),
            fromLonLat([118.17972266880879, 24.522478418040198]),
            fromLonLat([118.18129983320829, 24.52442517159934]),
            fromLonLat([118.18157815735003, 24.524768596999923]),
            fromLonLat([118.18181454369615, 24.524640165277553]),
            fromLonLat([118.18200407168888, 24.524702800554735]),
            fromLonLat([118.18217771529959, 24.525826326499864]),
            fromLonLat([118.18239917649053, 24.525931897141923]),
            fromLonLat([118.18215378543145, 24.525826371623815]),
            fromLonLat([118.18203211492013, 24.52615955383158]),
            fromLonLat([118.18220272815425, 24.526749156319784]),
            fromLonLat([118.18200734185744, 24.528472294704638]),
            fromLonLat([118.18014625470022, 24.531801382904817]),
            fromLonLat([118.17982817045528, 24.533254801680254]),
            fromLonLat([118.18029412675442, 24.535097687864219]),
            fromLonLat([118.18039192983169, 24.535934396838087]),
            fromLonLat([118.18022142405307, 24.536697621715103]),
            fromLonLat([118.18055760880472, 24.537148929820482]),
            fromLonLat([118.180298315692, 24.537897335017647]),
            fromLonLat([118.18072822710219, 24.537825528884245]),
            fromLonLat([118.18221343724564, 24.53708481863119]),
            fromLonLat([118.18302834076096, 24.536513351509193]),
            fromLonLat([118.18578135083889, 24.534965380993896]),
            fromLonLat([118.18662222605116, 24.534331900787418]),
            fromLonLat([118.18696735168969, 24.534072286683227]),
            fromLonLat([118.18888149555474, 24.53224298128341]),
            fromLonLat([118.18907203400663, 24.532479605955135]),
            fromLonLat([118.18914785474536, 24.532437471105816]),
            fromLonLat([118.18894832738223, 24.532188864102324]),
            fromLonLat([118.18911590593952, 24.532053580431203]),
            fromLonLat([118.1895409032756, 24.532621720431564]),
            fromLonLat([118.1896975112442, 24.532506445658406]),
            fromLonLat([118.19009457303278, 24.532980659307825]),
            fromLonLat([118.19125369229795, 24.532215649090325]),
            fromLonLat([118.19135744855787, 24.532334448285262]),
            fromLonLat([118.19128262424925, 24.532388578295627]),
            fromLonLat([118.19135944450385, 24.532486428603299]),
            fromLonLat([118.19200186561757, 24.532055311514831]),
            fromLonLat([118.19194000903778, 24.531965442791297]),
            fromLonLat([118.19184723729744, 24.532014605252478]),
            fromLonLat([118.19174747013498, 24.531887799143171]),
            fromLonLat([118.19199585680553, 24.53172636729704]),
            fromLonLat([118.19216147135228, 24.531943045305649]),
            fromLonLat([118.19501349485775, 24.530041194623788]),
            fromLonLat([118.19432706840034, 24.529167525617947]),
            fromLonLat([118.19432996363517, 24.527788701426978]),
            fromLonLat([118.1948776395582, 24.527526759364296]),
            fromLonLat([118.19544427440381, 24.52739378389693]),
            fromLonLat([118.19613564648755, 24.527351574489519]),
            fromLonLat([118.19684698090114, 24.527467309981482]),
            fromLonLat([118.19753835285844, 24.527332135492323]),
            fromLonLat([118.19773388840684, 24.527215810500728]),
            fromLonLat([118.1980331672118, 24.526873342534415]),
            fromLonLat([118.19820872313203, 24.526365107115698]),
            fromLonLat([118.19883824410164, 24.526076060723234]),
            fromLonLat([118.19919040309499, 24.525817499132099]),
            fromLonLat([118.19879023050933, 24.52431838075692]),
            fromLonLat([118.19914998882169, 24.518515571907642]),
            fromLonLat([118.19987218000543, 24.516409639493638]),
            fromLonLat([118.1998720262543, 24.514233955659243]),
            fromLonLat([118.19914954282093, 24.51220547364046]),
            fromLonLat([118.19958242868735, 24.510536988346317]),
            fromLonLat([118.19922113133576, 24.508724873572596]),
            fromLonLat([118.19994328273086, 24.506039058056864]),
            fromLonLat([118.200433921887, 24.50264975169371]),
            fromLonLat([118.19967266693504, 24.502705028793784]),
            fromLonLat([118.1986450403291, 24.502778768765499]),
            fromLonLat([118.19781195231106, 24.502604223775272]),
            fromLonLat([118.19770219290133, 24.502248471155713]),
            fromLonLat([118.19731608200766, 24.502073162768855]),
            fromLonLat([118.19721031194595, 24.501826389520346]),
            fromLonLat([118.19736389330191, 24.500987247202115]),
            fromLonLat([118.19689192943565, 24.500013229562153]),
            fromLonLat([118.19699568027144, 24.499930060568385]),
            fromLonLat([118.19655868922139, 24.49969085435449]),
            fromLonLat([118.1961137321846, 24.499620641793811]),
            fromLonLat([118.19615262472153, 24.49939861423908]),
            fromLonLat([118.19586330058947, 24.499298135234511]),
            fromLonLat([118.19588323972849, 24.499104136993388]),
            fromLonLat([118.19465611926556, 24.498653373382844]),
            fromLonLat([118.19448548427563, 24.498064767625056]),
            fromLonLat([118.19389189853213, 24.498006831399856]),
            fromLonLat([118.19285639397525, 24.498128667225291]),
            fromLonLat([118.1927625695825, 24.497416944900952]),
            fromLonLat([118.19238848063023, 24.497535601434723]),
            fromLonLat([118.19121431552367, 24.497528725896963]),
            fromLonLat([118.1912203483836, 24.49805763128828]),
            fromLonLat([118.19070259068354, 24.497944588348407]),
            fromLonLat([118.19046520131718, 24.498249968490025]),
            fromLonLat([118.19027367066386, 24.498274314564721]),
            fromLonLat([118.19015597428842, 24.498500498128941]),
            fromLonLat([118.18931799609264, 24.498073101849805]),
            fromLonLat([118.18911645183522, 24.497523558470689]),
            fromLonLat([118.1883313863793, 24.497567997553176]),
            fromLonLat([118.188063054713, 24.497662479670385]),
            fromLonLat([118.18748348716186, 24.497816520147506]),
            fromLonLat([118.18691290071345, 24.497690605783855]),
            fromLonLat([118.18662561385517, 24.497702137915304]),
            fromLonLat([118.18658671547858, 24.497774190193866]),
            fromLonLat([118.18616275587675, 24.497741993628622]),
            fromLonLat([118.18619964919984, 24.497389974025111]),
            fromLonLat([118.18608590850438, 24.497202222124333]),
            fromLonLat([118.18442491158127, 24.495143656201485]),
            fromLonLat([118.18442290990242, 24.495049673289383]),
            fromLonLat([118.18476501594749, 24.494632101815977]),
            fromLonLat([118.18480786422369, 24.493861151639365]),
            fromLonLat([118.18461426353929, 24.492679703895575]),
            fromLonLat([118.18445563656776, 24.492354058119854]),
            fromLonLat([118.18427608034439, 24.492285404642903]),
            fromLonLat([118.18380130616295, 24.492826207490257]),
            fromLonLat([118.18366467455472, 24.493338380437724]),
            fromLonLat([118.18353302925939, 24.4935505973429]),
            fromLonLat([118.18294850983807, 24.493912634895189]),
            fromLonLat([118.18223034181489, 24.494186938760187]),
            fromLonLat([118.18163687069718, 24.494711973766151]),
            fromLonLat([118.18140947943515, 24.495229319732118]),
            fromLonLat([118.18133770036071, 24.495796365093039]),
            fromLonLat([118.18116418021314, 24.49640358739472]),
            fromLonLat([118.1802725070895, 24.497543094232942]),
            fromLonLat([118.18023460177683, 24.497531167643032]),
            fromLonLat([118.17921310425839, 24.496494267687879]),
            fromLonLat([118.17966691558654, 24.495879514404532]),
            fromLonLat([118.18009376470241, 24.494831874465781]),
            fromLonLat([118.18028127277212, 24.49456055813004]),
            fromLonLat([118.1803341144137, 24.494206518608664]),
            fromLonLat([118.1804936994025, 24.494025252520327]),
            fromLonLat([118.1805634847003, 24.493619178617873]),
            fromLonLat([118.18006872566518, 24.493396156988467]),
            fromLonLat([118.17959184794063, 24.492268242689921]),
            fromLonLat([118.17810165831533, 24.493093938777601]),
            fromLonLat([118.17707327213932, 24.493313848433289]),
            fromLonLat([118.17493670283952, 24.49361484914894]),
          ],
        ]),
      }),
    },
  ];

  active.value = "湖里区";
  loadMap();
  console.log(mapData);
};

let getMonitorList = async () => {
  let result = (
    await axios.post(DOMINIP + "/gy/att-camera-device-list/page", {
      pageNo: 1,
      pageSize: 800,
    })
  ).data;

  //过滤离线的监控
  monitorList.value = result.data.records;
  getCarouselList();
};

let getPersonInfo = async () => {
  let result = (
    await axios.post(DOMINIP + "/gy/att-person-info/page", {
      pageNo: 1,
      pageSize: 500,
    })
  ).data;

  duteList.value = result.data.records;

  duteListBK.value = result.data.records.filter((item) => item.type == 1 && item.status == 1);
  duteListFK.value = result.data.records.filter((item) => item.type == 2 && item.status == 1);
  console.log(result.data.records);
};

let saveOverviewInfo = async (content) => {
  await axios.post(DOMINIP + "/gy/att-overview/edit", {
    content,
  });
  alert("保存成功");
  overview.value = content;
  isShowEdit.value = false;
};

let getRemarkInfo = async (id) => {
  let result = (await axios.get(DOMINIP + "/gy/att-camera-device-list/info?id=" + id, {})).data;
  return result.data.remark || "";
};

let saveRemarkInfo = async (content) => {
  await axios.post(DOMINIP + "/gy/att-camera-device-list/saveOrEdit", {
    id: currentRemark.value.id,
    remark: content,
  });
  alert("保存成功");
  currentRemark.value = {};
  document.getElementById("c-remarktxt").innerHTML = content;
  isShowEdit.value = false;
};

let getAllMonitorList = async () => {
  let result = await axios.get(jiankongDomain + "/paths/list");
  console.log(result);
};

let deleteMonitor = async () => {
  try {
    await axios.delete(jiankongDomain + "/config/paths/delete/" + rtspName);
  } catch (error) {
  } finally {
  }
};

let addMonitor = async (url) => {
  await axios.post(jiankongDomain + "/config/paths/add/" + rtspName, {
    source: url,
  });
};

let searchDevice = () => {
  if (searchName.value) {
    jiankongs.value = mapData.filter((item) => {
      let searchItem = item.code + item.name + item.address;
      return searchItem.indexOf(searchName.value) > -1;
    });

    updateJK();
  } else {
    activeActionFn();
  }
};

let activeActionFn = () => {
  if (active.value == "湖里区") {
    jiankongs.value = mapData;
  } else {
    jiankongs.value = mapData.filter((item) => {
      return item.type == active.value;
    });
  }

  console.log("result:jiankongs.value", jiankongs.value);

  let activeItem = list.value.find((item) => item.name == active.value);
  closer && closer.click();
  map &&
    map.getView().animate({
      center: fromLonLat(activeItem.lonlat),
      zoom: activeItem.zoom || Math.max(map.getView().getZoom(), defaultZoom),
      duration: 500,
    });
  updateRoad(activeItem);
};

let editCam = (data) => {
  currentRemark.value = data;
  defaultTxt.value = data.remark;
  isShowEdit.value = true;
};

let clickMoniTorItem = async (data) => {
  console.log(data, "dadadadad");
  let featureData = data;

  // addMonitor(`rtsp://admin:HK888888@${featureData.ip}/h264/ch1/sub/av_stream`);
  content.innerHTML = "";

  // // 清空html

  let remarkinfo = await getRemarkInfo(featureData.id);
  // content.appendChild(latitude);
  var iframe = document.createElement("iframe");

  var div = document.createElement("div");
  var maindiv = document.createElement("div");
  var clkdiv = document.createElement("clkdiv");
  
  clkdiv.removeEventListener("dblclick", clickIfr);
  clkdiv.addEventListener("dblclick", clickIfr);

  var title = document.createElement("div");
  var remark = document.createElement("div");

  remark.innerHTML = `<div>
          <span>备注内容</span>
          <img id='c-remark' class="bg" src="/images/ct_edit.png" alt="">
          </div>
          <div id='c-remarktxt' class='p-content'>${remarkinfo}</div>
        `;

  div.innerText = "正在加载中... 请稍候";
  clkdiv.dataset.ip = featureData.ip
  title.innerText = featureData.name;

  // div.classList.add("donmask");
  title.classList.add("poptitle");
  remark.classList.add("popremark");
  maindiv.classList.add("maindiv");
  clkdiv.classList.add("clkdiv");

  

  // 设置iframe的属性
  iframe.src = IP + ":8877/cn/demo-easy.html?width=600&height=400&streamType=2&ip=" + featureData.ip; // 设置iframe的src属性，指定要加载的URL
  // iframe.src = IP + ":8888/" + rtspName; // 设置iframe的src属性，指定要加载的URL
  iframe.width = "600"; // 设置iframe的宽度
  iframe.height = "400"; // 设置iframe的高度
  // content.appendChild(div);
  content.appendChild(title);
  maindiv.appendChild(iframe);
  maindiv.appendChild(remark);
  maindiv.appendChild(clkdiv);
  content.appendChild(maindiv);

  document.getElementById("c-remark").addEventListener("click", async () => {
    editCam({ ...featureData, remark: await getRemarkInfo(featureData.id) });
  });

  // setTimeout(() => {
  //   try {
  //     content.removeChild(div);
  //   } catch (error) {}
  // }, 2000);

  // 弹出popup

  // 聚焦到点击位置
  // map.getView().animate({
  //   zoom: Math.max(map.getView().getZoom(), defaultZoom),
  //   duration: 500,
  // });

  popup.setPosition(map.getView().getCenter());
};

let clickIfr = (e) => {
  console.log('result:', e);
  isShowFullIfr.value = true;
  let {ip} = e.target.dataset
  currentIfr.value = IP + ":8877/cn/demo-easy.html?streamType=1&ip=" + ip +`&width=${window.innerWidth * 0.9}&height=${window.innerHeight * 0.9}`;
};

let loadMap = () => {
  map = new Map({
    target: "map",
    layers: [
      new TileLayer({
        className: "blueLayer",
        source: new XYZ({
          url: DOMINIP + "/gisWeb/{z}/{x}/{y}/tile.png",
          // url: "http://192.168.3.172:8080/{z}/{x}/{y}/tile.png",
          // url: 'https://webst{s}.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}'
          // url: 'https://webst01.is.autonavi.com/appmaptile?style=6&x={x}&y={y}&z={z}'
        }),
      }),
      vectorLayer,
    ],
    view: new View({
      center: fromLonLat(list.value[0].lonlat),
      zoom: 12,
      // // 设置最小缩放级别
      minZoom: 10,
      // 设置最大缩放级别
      maxZoom: 18,
      extent: extent,
      // controls: defaultControls().extend([new ZoomSlider()]),
    }),
  });

  // 获取popup的dom对象
  container = document.getElementById("popup");
  content = document.getElementById("popup-content");
  closer = document.getElementById("popup-closer");

  // 创建popup
  popup = new Overlay({
    element: container,
    autoPan: true,
    positioning: "bottom-center",
    stopEvent: false,
    autoPanAnimation: {
      duration: 250,
    },
  });
  map.addOverlay(popup);

  // 关闭popup
  closer.onclick = function (e) {
    e.preventDefault();
    // deleteMonitor();
    content.innerHTML = "";
    popup.setPosition(undefined);
    closer.blur();
    clickClose = true;
    setTimeout(() => {
      clickClose = false;
    }, 100);
    return false;
  };

  // change mouse cursor when over marker
  map.on("pointermove", function (e) {
    const pixel = map.getEventPixel(e.originalEvent);
    const hit = map.hasFeatureAtPixel(pixel);
    map.getTargetElement().style.cursor = hit ? "pointer" : "";
  });

  // 监听鼠标单击事件，点击feature后弹出popup
  map.on("click", async function (e) {
    var coordinate = e.coordinate;
    console.log("result:coordinate", coordinate);

    setTimeout(async () => {
      if (clickClose) {
        clickClose = false;
        return;
      }
      // closer.click()
      var feature = map.forEachFeatureAtPixel(e.pixel, function (feature, layer) {
        return feature;
      });

      if (feature) {
        let featureData = feature.get("data");
        console.log("result:featureData", featureData);
        if (featureData && featureData.short) {
          updateJK();
          return;
        }
        let onlinestate = featureData.onlinestate;
        // if (onlinestate == 0) return;
        // closer.click();
        // addMonitor(`rtsp://admin:HK888888@${featureData.ip}/h264/ch1/sub/av_stream`);
        content.innerHTML = "";

        // // 清空html

        let remarkinfo = await getRemarkInfo(featureData.id);
        // content.appendChild(latitude);
        var iframe = document.createElement("iframe");

        var div = document.createElement("div");
        var maindiv = document.createElement("div");
        var clkdiv = document.createElement("clkdiv");
        
        var title = document.createElement("div");
        var remark = document.createElement("div");

        remark.innerHTML = `<div>
              <span>备注内容</span>
              <img id='c-remark' class="bg" src="/images/ct_edit.png" alt="">
              </div>
              <div id='c-remarktxt' class='p-content'>${remarkinfo}</div>
            `;

        div.innerText = "正在加载中... 请稍候";
        title.innerText = featureData.code + ". " + featureData.address;
        clkdiv.dataset.ip = featureData.ip

        // div.classList.add("donmask");
        title.classList.add("poptitle");
        remark.classList.add("popremark");
        maindiv.classList.add("maindiv");
        clkdiv.classList.add("clkdiv");
        // 设置iframe的属性
        iframe.src = IP + ":8877/cn/demo-easy.html?streamType=2&ip=" + featureData.ip; // 设置iframe的src属性，指定要加载的URL
        iframe.width = "600"; // 设置iframe的宽度
        iframe.height = "400"; // 设置iframe的高度
        // content.appendChild(div);
        content.appendChild(title);
        maindiv.appendChild(iframe);
        maindiv.appendChild(remark);
        maindiv.appendChild(clkdiv);

        content.appendChild(maindiv);

        clkdiv.removeEventListener("dblclick", clickIfr);
        clkdiv.addEventListener("dblclick", clickIfr);

        document.getElementById("c-remark").addEventListener("click", async () => {
          editCam({ ...featureData, remark: await getRemarkInfo(featureData.id) });
        });

        // setTimeout(() => {
        //   try {
        //     content.removeChild(div);
        //   } catch (error) {}
        // }, 2000);

        // 弹出popup

        // 计算偏移量
        var offsetY = -1000; // 向上偏移的像素值

        // 聚焦到点击位置
        map.getView().animate({
          // center: [featureExtent[0], featureExtent[1] + offsetY, featureExtent[2], featureExtent[3] + offsetY],
          center: [coordinate[0], coordinate[1] + offsetY],
          zoom: Math.max(map.getView().getZoom(), defaultZoom),
          duration: 500,
        });
        setTimeout(() => {
          let center = map.getView().getCenter();
          popup.setPosition(center);
        }, 800);
      }
    }, 100);
  });
};

let getScreenPublicity =async ()=>{
  let resp = (await axios.post(DOMINIP + '/gy/att-screen-distribution/list')).data.data
  
  console.log('result:12222111',resp );
  screenList.value = resp
  // console.log('result:',screenList.value );
}


watch(
  active,
  () => {
    console.log("result:2", active.value);
    activeActionFn();
  },
  {
    immediate: true,
  }
);

onMounted(async () => {
  setInterval(updateClock, 1000);
  await getDeviceList();
  getOverviewInfo();
  getPersonInfo();
  getMonitorList();
  getScreenPublicity()

  // 创建矢量图层和矢量数据源
});
</script>

<style lang="scss" scoped>
@import url(./app.scss);
</style>
